summaryrefslogtreecommitdiff
path: root/include/my_global.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/my_global.h')
-rw-r--r--include/my_global.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/my_global.h b/include/my_global.h
index 3d1a770d877..ca45406355e 100644
--- a/include/my_global.h
+++ b/include/my_global.h
@@ -1102,6 +1102,14 @@ do { doubleget_union _tmp; \
#endif /* sint2korr */
/*
+ Macro for reading 32-bit integer from network byte order (big-endian)
+ from unaligned memory location.
+*/
+#define int4net(A) (int32) (((uint32) ((uchar) (A)[3])) |\
+ (((uint32) ((uchar) (A)[2])) << 8) |\
+ (((uint32) ((uchar) (A)[1])) << 16) |\
+ (((uint32) ((uchar) (A)[0])) << 24))
+/*
Define-funktions for reading and storing in machine format from/to
short/long to/from some place in memory V should be a (not
register) variable, M is a pointer to byte