diff options
author | Derrell Lipman <derrell.lipman@unwireduniverse.com> | 2008-02-26 21:43:13 -0500 |
---|---|---|
committer | Derrell Lipman <derrell.lipman@unwireduniverse.com> | 2008-02-26 21:43:13 -0500 |
commit | 346c94972a0c603ecf8dd5690822c107dbeacc67 (patch) | |
tree | 331174abcf03d4284635de943ea1d1c7285d044c /source3 | |
parent | c58e7427bf7200ad413c259f429f020b98d723ec (diff) | |
download | samba-346c94972a0c603ecf8dd5690822c107dbeacc67.tar.gz samba-346c94972a0c603ecf8dd5690822c107dbeacc67.tar.bz2 samba-346c94972a0c603ecf8dd5690822c107dbeacc67.zip |
add 64-bit macros from samba4
(This used to be commit a19e5fd5846685d5264e92bedf5cb57d99271f28)
Diffstat (limited to 'source3')
-rw-r--r-- | source3/include/byteorder.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/source3/include/byteorder.h b/source3/include/byteorder.h index 32138a89ce..9ced9cea3a 100644 --- a/source3/include/byteorder.h +++ b/source3/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 */ |