diff options
author | NIIBE Yutaka <gniibe@fsij.org> | 2022-01-25 10:42:52 +0900 |
---|---|---|
committer | NIIBE Yutaka <gniibe@fsij.org> | 2022-01-25 10:42:52 +0900 |
commit | 3d353782d84b9720262d7b05adfae3aef7ff843b (patch) | |
tree | 824071e0184bf385480f970648b9ced2ba698210 /src/types.h | |
parent | 99642f18ccbe45fb4cae55945af49f7884bcaceb (diff) | |
download | libgcrypt-3d353782d84b9720262d7b05adfae3aef7ff843b.tar.gz |
Prefer uint64_t for the definition of u64.
* src/types.h (u64): Prefer use of uint64_t with C99 compliant
compiler.
--
In libgcrypt, we use u64 for 64-bit unsigned integer, it's before C99.
Newer jitterentropy introduces use of uint64_t.
In LP64 systems, there are two variants: (1) uint64_t is defined as
unsigned long, (2) uint64_t is defined as unsigned long long.
macOS is the latter.
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
Diffstat (limited to 'src/types.h')
-rw-r--r-- | src/types.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/types.h b/src/types.h index abcba2b9..b4f28bc4 100644 --- a/src/types.h +++ b/src/types.h @@ -101,7 +101,11 @@ */ #ifndef HAVE_TYPE_U64 # undef u64 /* In case there is a macro with that name. */ -# if SIZEOF_UNSIGNED_INT == 8 +# if SIZEOF_UINT64_T == 8 + typedef uint64_t u64; +# define U64_C(c) (UINT64_C(c)) +# define HAVE_TYPE_U64 +# elif SIZEOF_UNSIGNED_INT == 8 typedef unsigned int u64; # define U64_C(c) (c ## U) # define HAVE_TYPE_U64 @@ -113,10 +117,6 @@ typedef unsigned long long u64; # define U64_C(c) (c ## ULL) # define HAVE_TYPE_U64 -# elif SIZEOF_UINT64_T == 8 - typedef uint64_t u64; -# define U64_C(c) (UINT64_C(c)) -# define HAVE_TYPE_U64 # else # error No way to declare a 64 bit integer type # endif |