diff options
author | Daniel Spangberg <daniels@kemi.uu.se> | 2013-05-15 16:36:11 (GMT) |
---|---|---|
committer | Daniel Spangberg <daniels@kemi.uu.se> | 2013-05-15 16:36:11 (GMT) |
commit | 33516bd35c7da26e5e7f164f7ce4fa05808e8bd7 (patch) | |
tree | bafa61397a39881205905e5bdd7dcb85828af625 /include/compression | |
parent | 6a029e5396c38c20c16fdd7ee3e6c96bcd18e396 (diff) |
fix compression include file my64bit.h to first test inttypes, then do some other tests to find a 64 bit int.
Diffstat (limited to 'include/compression')
-rw-r--r-- | include/compression/my64bit.h | 50 |
1 files changed, 9 insertions, 41 deletions
diff --git a/include/compression/my64bit.h b/include/compression/my64bit.h index fb2d5d0..011acfb 100644 --- a/include/compression/my64bit.h +++ b/include/compression/my64bit.h @@ -10,58 +10,26 @@ * of the License, or (at your option) any later version. */ - -/* Here presence of 64 bit integers are checked for. If on windows - define USE_WINDOWS if it does not get defined automatically. - If on UNIX, define the sizes of SIZEOF_INT, SIZEOF_LONG, SIZEOF_LONG_LONG - If none of these symbols are defined, stdint.h is included (if on C99 - or USE_STDINT is defined) and 64 bit integers are assumed to be - present. If none of this is fulfilled, 64 bit integers are not - available. */ - #ifndef MY64BIT_H #define MY64BIT_H -#if HAVE_CONFIG_H -#include <config.h> -#endif - -#if HAVE_STDINT_H -#include <stdint.h> -#endif - +#ifdef USE_STD_INTTYPES_H +#include <inttypes.h> +typedef int64_t my_int64_t; +typedef uint64_t my_uint64_t; +#define HAVE64BIT +#else /* USE_STD_INTTYPES */ /* The USE_WINDOWS symbol should be automatically defined in tng_compress.h */ #include "tng_compress.h" - #ifdef USE_WINDOWS typedef __int64 my_int64_t; typedef unsigned __int64 my_uint64_t; #define HAVE64BIT #else /* USE_WINDOWS */ -/* UNIX. Use config.h */ -#if SIZEOF_INT >= 8 -typedef int my_int64_t; -typedef unsigned int my_uint64_t; -#define HAVE64BIT -#else /* SIZEOF_INT */ -#if SIZEOF_LONG >= 8 -typedef long my_int64_t; -typedef unsigned long my_uint64_t; -#define HAVE64BIT -#else /* SIZEOF_LONG */ -#if SIZEOF_LONG_LONG >= 8 -typedef long long my_int64_t; +/* Fall back to assume that we have unsigned long long */ typedef unsigned long long my_uint64_t; #define HAVE64BIT -#else /* SIZEOF_LONG_LONG */ -#if HAVE_STDINT_H -typedef int64_t my_int64_t; -typedef uint64_t my_uint64_t; -#define HAVE64BIT -#endif /* STDINT_H */ -#endif /* SIZEOF_LONG_LONG */ -#endif /* SIZEOF_LONG */ -#endif /* SIZEOF_INT */ -#endif /* USE_WINDOWS */ +#endif /* USE_WINDOWS */ +#endif /* USE_STD_INTTYPES */ #endif |