From: Will Estes Date: Wed, 27 Nov 2002 18:41:07 +0000 (+0000) Subject: integer types for non-C99 systems flexint.h X-Git-Tag: flex-2-5-25~7 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b0f78600341fec227c2b8f87e4872a66f84be3db;p=flex integer types for non-C99 systems flexint.h --- diff --git a/flexint.h b/flexint.h index 5ce1f95..32062a4 100644 --- a/flexint.h +++ b/flexint.h @@ -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 . Non-C99 systems may or may not. */ #if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L #include @@ -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 #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