diff options
author | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2012-06-05 19:09:11 +0200 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2012-06-05 19:09:11 +0200 |
commit | 398220fa033091b34ddb80723f379ffe701fc052 (patch) | |
tree | cac2c192e3c63cdd19111f45a8fc6da2db38fcd6 /gl/u64.h | |
parent | e0fc4ac94721ec49044927bdadcc843e881e4c22 (diff) | |
download | gnutls-398220fa033091b34ddb80723f379ffe701fc052.tar.gz |
updated gnulibgnutls_3_0_20
Diffstat (limited to 'gl/u64.h')
-rw-r--r-- | gl/u64.h | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -30,6 +30,7 @@ typedef uint64_t u64; # define u64hilo(hi, lo) ((u64) (((u64) (hi) << 32) + (lo))) # define u64init(hi, lo) u64hilo (hi, lo) # define u64lo(x) ((u64) (x)) +# define u64size(x) u64lo (x) # define u64lt(x, y) ((x) < (y)) # define u64and(x, y) ((x) & (y)) # define u64or(x, y) ((x) | (y)) @@ -72,6 +73,16 @@ u64lo (uint32_t lo) return r; } +/* Return a u64 value representing SIZE. */ +static inline u64 +u64size (size_t size) +{ + u64 r; + r.hi = size >> 31 >> 1; + r.lo = size; + return r; +} + /* Return X < Y. */ static inline int u64lt (u64 x, u64 y) |