diff options
-rw-r--r-- | lib.c | 8 | ||||
-rw-r--r-- | lib.h | 3 |
2 files changed, 11 insertions, 0 deletions
@@ -807,6 +807,14 @@ void create_builtin_stream(void) add_pre_buffer("#define __OPTIMIZE__ 1\n"); if (optimize_size) add_pre_buffer("#define __OPTIMIZE_SIZE__ 1\n"); + + /* GCC defines these for limits.h */ + add_pre_buffer("#weak_define __SHRT_MAX__ " STRINGIFY(__SHRT_MAX__) "\n"); + add_pre_buffer("#weak_define __SCHAR_MAX__ " STRINGIFY(__SCHAR_MAX__) "\n"); + add_pre_buffer("#weak_define __INT_MAX__ " STRINGIFY(__INT_MAX__) "\n"); + add_pre_buffer("#weak_define __LONG_MAX__ " STRINGIFY(__LONG_MAX__) "\n"); + add_pre_buffer("#weak_define __LONG_LONG_MAX__ " STRINGIFY(__LONG_LONG_MAX__) "\n"); + add_pre_buffer("#weak_define __WCHAR_MAX__ " STRINGIFY(__WCHAR_MAX__) "\n"); } static struct symbol_list *sparse_tokenstream(struct token *token) @@ -17,6 +17,9 @@ #include "compat.h" #include "ptrlist.h" +#define DO_STRINGIFY(x) #x +#define STRINGIFY(x) DO_STRINGIFY(x) + extern int verbose, optimize, optimize_size, preprocessing; extern int die_if_error; extern int repeat_phase, merge_phi_sources; |