Skip to content

Commit

Permalink
Merge pull request westes#531 from Explorer09/flexint-include
Browse files Browse the repository at this point in the history
Also check for C++ standard version when deciding to include <stdint.h>
  • Loading branch information
westes authored Jun 17, 2022
2 parents 74a89fd + 8ab4ea7 commit 1656033
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/flexint_shared.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@
#define YYFLEX_INTTYPES_DEFINED

/* Prefer C99 integer types if available. */

# if defined(__cplusplus) && __cplusplus >= 201103L
#include <cstdint>
# define YYFLEX_USE_STDINT
# endif
# if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
/* Include <inttypes.h> and not <stdint.h> because Solaris 2.6 has the former
* and not the latter.
Expand Down Expand Up @@ -33,7 +38,11 @@ typedef unsigned short int flex_uint16_t;
# ifdef __STDC__
typedef signed char flex_int8_t;
/* ISO C only requires at least 16 bits for int. */
# ifdef __cplusplus
#include <climits>
# else
#include <limits.h>
# endif
# if UINT_MAX >= 4294967295
# define YYFLEX_INT32_DEFINED
typedef int flex_int32_t;
Expand Down

0 comments on commit 1656033

Please sign in to comment.