diff options
-rw-r--r-- | flexint.h | 42 |
1 files changed, 12 insertions, 30 deletions
@@ -3,13 +3,7 @@ #ifndef FLEXINT_H #define FLEXINT_H -/* try to get all the integer types */ - -/* if you're a C99 system, then you should say so and we just include -the inttypes.h header. If you're not C99, by default we try to include -sys/types.h. If that doesn't work for you, then define -FLEX_NEED_INTEGRAL_TYPE_DEFINITIONS. If that gives you problems, check -that your header files and such are happy. */ +/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */ #if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L #include <inttypes.h> @@ -19,36 +13,24 @@ typedef int16_t flex_int16_t; typedef uint16_t flex_uint16_t; typedef int32_t flex_int32_t; typedef uint32_t flex_uint32_t; -#endif -#ifndef FLEX_NEED_INTEGRAL_TYPE_DEFINITIONS -#include <sys/types.h> #else -/* Exact integral types. */ - -/* Signed. */ - -typedef signed char int8_t; -typedef short int int16_t; -typedef int int32_t; - +typedef signed char flex_int8_t; +typedef short int flex_int16_t; +typedef int flex_int32_t; # if __WORDSIZE == 64 || defined __arch64__ || defined __cplusplus -typedef long int int64_t; +typedef long int flex_int64_t; # else -typedef long long int int64_t; +typedef long long int flex_int64_t; # endif - -/* Unsigned. */ - -typedef unsigned char uint8_t; -typedef unsigned short int uint16_t; -typedef unsigned int uint32_t; - +typedef unsigned char flex_uint8_t; +typedef unsigned short int flex_uint16_t; +typedef unsigned int flex_uint32_t; #if __WORDSIZE == 64 || defined __arch64__ || defined __cplusplus -typedef unsigned long int uint64_t; +typedef unsigned long int flex_uint64_t; #else -typedef unsigned long long int uint64_t; +typedef unsigned long long int flex_uint64_t; #endif -#endif /* FLEX_NEED_INTEGRAL_TYPE_DEFINITIONS */ +#endif /* ! C99 */ /* Limits of integral types. */ #ifndef INT8_MIN |