summaryrefslogtreecommitdiff
path: root/flexint.h
diff options
context:
space:
mode:
authorAnas Nashif <anas.nashif@intel.com>2012-11-04 18:16:55 -0800
committerAnas Nashif <anas.nashif@intel.com>2012-11-04 18:16:55 -0800
commitc29d6e204b4dfe99a2f08c258652823e4c26c324 (patch)
treefb8afee4077c205ae70ed28fbeca06f4bb43690a /flexint.h
downloadflex-c29d6e204b4dfe99a2f08c258652823e4c26c324.tar.gz
flex-c29d6e204b4dfe99a2f08c258652823e4c26c324.tar.bz2
flex-c29d6e204b4dfe99a2f08c258652823e4c26c324.zip
Imported Upstream version 2.5.35upstream/2.5.35
Diffstat (limited to 'flexint.h')
-rw-r--r--flexint.h63
1 files changed, 63 insertions, 0 deletions
diff --git a/flexint.h b/flexint.h
new file mode 100644
index 0000000..60e9127
--- /dev/null
+++ b/flexint.h
@@ -0,0 +1,63 @@
+/* flex integer type definitions */
+
+#ifndef FLEXINT_H
+#define FLEXINT_H
+
+/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
+
+#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+
+/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
+ * if you want the limit (max/min) macros for int types.
+ */
+#ifndef __STDC_LIMIT_MACROS
+#define __STDC_LIMIT_MACROS 1
+#endif
+
+#include <inttypes.h>
+typedef int8_t flex_int8_t;
+typedef uint8_t flex_uint8_t;
+typedef int16_t flex_int16_t;
+typedef uint16_t flex_uint16_t;
+typedef int32_t flex_int32_t;
+typedef uint32_t flex_uint32_t;
+#else
+typedef signed char flex_int8_t;
+typedef short int flex_int16_t;
+typedef int flex_int32_t;
+typedef unsigned char flex_uint8_t;
+typedef unsigned short int flex_uint16_t;
+typedef unsigned int flex_uint32_t;
+#endif /* ! C99 */
+
+/* Limits of integral types. */
+#ifndef INT8_MIN
+#define INT8_MIN (-128)
+#endif
+#ifndef INT16_MIN
+#define INT16_MIN (-32767-1)
+#endif
+#ifndef INT32_MIN
+#define INT32_MIN (-2147483647-1)
+#endif
+#ifndef INT8_MAX
+#define INT8_MAX (127)
+#endif
+#ifndef INT16_MAX
+#define INT16_MAX (32767)
+#endif
+#ifndef INT32_MAX
+#define INT32_MAX (2147483647)
+#endif
+#ifndef UINT8_MAX
+#define UINT8_MAX (255U)
+#endif
+#ifndef UINT16_MAX
+#define UINT16_MAX (65535U)
+#endif
+#ifndef UINT32_MAX
+#define UINT32_MAX (4294967295U)
+#endif
+
+
+#endif /* ! FLEXINT_H */