Created
December 8, 2014 07:55
-
-
Save towry/f7c80fed74b625ce30fd to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 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; | |
/* 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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment