From 1e6592941b0e9d6195147d887b813aa57da90324 Mon Sep 17 00:00:00 2001 From: David Shaw Date: Wed, 14 May 2003 04:32:32 +0000 Subject: [PATCH] * types.h: Add initializer macros for 64-bit unsigned type. --- include/ChangeLog | 4 ++++ include/types.h | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/include/ChangeLog b/include/ChangeLog index f495540f9..47f1b4661 100644 --- a/include/ChangeLog +++ b/include/ChangeLog @@ -1,3 +1,7 @@ +2003-05-14 David Shaw + + * types.h: Add initializer macros for 64-bit unsigned type. + 2003-05-02 David Shaw * cipher.h: Add constants for compression algorithms. diff --git a/include/types.h b/include/types.h index 0b4f6a485..83c0977da 100644 --- a/include/types.h +++ b/include/types.h @@ -21,7 +21,7 @@ #ifndef G10_TYPES_H #define G10_TYPES_H -#if HAVE_INTTYPES_H +#ifdef HAVE_INTTYPES_H /* For uint64_t */ #include #endif @@ -103,15 +103,19 @@ #undef u64 /* maybe there is a macro with this name */ #if SIZEOF_UNSIGNED_INT == 8 typedef unsigned int u64; + #define U64_C(c) (c ## U) #define HAVE_U64_TYPEDEF #elif SIZEOF_UNSIGNED_LONG == 8 typedef unsigned long u64; + #define U64_C(c) (c ## UL) #define HAVE_U64_TYPEDEF #elif SIZEOF_UNSIGNED_LONG_LONG == 8 typedef unsigned long long u64; + #define U64_C(c) (c ## ULL) #define HAVE_U64_TYPEDEF #elif SIZEOF_UINT64_T == 8 typedef uint64_t u64; + #define U64_C(c) (UINT64_C(c)) #define HAVE_U64_TYPEDEF #endif #endif