aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Shaw <[email protected]>2003-05-09 22:01:33 +0000
committerDavid Shaw <[email protected]>2003-05-09 22:01:33 +0000
commit47e1b3f9936bc87cbd1f32793019c57f970a8588 (patch)
tree2ca932ac5cb44c54cc32b60ec1b75c7a27260cac
parent* configure.ac: Simpler implementation for the 64-bit question - we don't (diff)
downloadgnupg-47e1b3f9936bc87cbd1f32793019c57f970a8588.tar.gz
gnupg-47e1b3f9936bc87cbd1f32793019c57f970a8588.zip
* types.h: Add typedef and initializer macro for 64-bit unsigned type.
-rw-r--r--include/ChangeLog5
-rw-r--r--include/types.h11
2 files changed, 16 insertions, 0 deletions
diff --git a/include/ChangeLog b/include/ChangeLog
index 454863188..314913e9d 100644
--- a/include/ChangeLog
+++ b/include/ChangeLog
@@ -1,3 +1,8 @@
+2003-05-09 David Shaw <[email protected]>
+
+ * types.h: Add typedef and initializer macro for 64-bit unsigned
+ type.
+
2003-05-02 David Shaw <[email protected]>
* cipher.h: Add constants for compression algorithms.
diff --git a/include/types.h b/include/types.h
index b41109ee5..83c0977da 100644
--- a/include/types.h
+++ b/include/types.h
@@ -21,6 +21,10 @@
#ifndef G10_TYPES_H
#define G10_TYPES_H
+#ifdef HAVE_INTTYPES_H
+/* For uint64_t */
+#include <inttypes.h>
+#endif
/* The AC_CHECK_SIZEOF() in configure fails for some machines.
* we provide some fallback values here */
@@ -99,12 +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