add 64-bit macros from samba4
authorDerrell Lipman <derrell.lipman@unwireduniverse.com>
Wed, 27 Feb 2008 02:43:13 +0000 (21:43 -0500)
committerDerrell Lipman <derrell.lipman@unwireduniverse.com>
Wed, 27 Feb 2008 02:43:13 +0000 (21:43 -0500)
(This used to be commit a19e5fd5846685d5264e92bedf5cb57d99271f28)

source3/include/byteorder.h

index 32138a89ce55e0499dcd0da1aa5413be901b0c89..9ced9cea3ae9958de4078ce88f0d824d5b2adbac 100644 (file)
@@ -167,4 +167,10 @@ it also defines lots of intermediate macros, just ignore those :-)
 #define ALIGN4(p,base) ((p) + ((4 - (PTR_DIFF((p), (base)) & 3)) & 3))
 #define ALIGN2(p,base) ((p) + ((2 - (PTR_DIFF((p), (base)) & 1)) & 1))
 
+/* 64 bit macros */
+#define BVAL(p, ofs) (IVAL(p,ofs) | (((uint64_t)IVAL(p,(ofs)+4)) << 32))
+#define BVALS(p, ofs) ((int64_t)BVAL(p,ofs))
+#define SBVAL(p, ofs, v) (SIVAL(p,ofs,(v)&0xFFFFFFFF), SIVAL(p,(ofs)+4,((uint64_t)(v))>>32))
+#define SBVALS(p, ofs, v) (SBVAL(p,ofs,(uint64_t)v))
+
 #endif /* _BYTEORDER_H */