From: Derrell Lipman Date: Wed, 27 Feb 2008 02:43:13 +0000 (-0500) Subject: add 64-bit macros from samba4 X-Git-Tag: samba-3.2.0pre2~37^2~126 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a19e5fd5846685d5264e92bedf5cb57d99271f28;p=thirdparty%2Fsamba.git add 64-bit macros from samba4 --- diff --git a/source/include/byteorder.h b/source/include/byteorder.h index 32138a89ce5..9ced9cea3ae 100644 --- a/source/include/byteorder.h +++ b/source/include/byteorder.h @@ -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 */