From: John Millaway Date: Tue, 21 Mar 2006 02:17:56 +0000 (+0000) Subject: Relaxed tests for __STDC__ and __STDC_VERSION__ to cope with bugs in GCC and Sun cc. X-Git-Tag: flex-2-5-34~107 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=81351ccb95e44db2c7d161c172b8f6e280ae457a;p=flex Relaxed tests for __STDC__ and __STDC_VERSION__ to cope with bugs in GCC and Sun cc. --- diff --git a/flex.skl b/flex.skl index 683ead6..482d76c 100644 --- a/flex.skl +++ b/flex.skl @@ -200,11 +200,12 @@ m4preproc_include(`flexint.h') #else /* ! __cplusplus */ -#if __STDC__ +/* C99 requires __STDC__ to be defined as 1. */ +#if defined (__STDC__) #define YY_USE_CONST -#endif /* __STDC__ */ +#endif /* defined (__STDC__) */ #endif /* ! __cplusplus */ #ifdef YY_USE_CONST diff --git a/flexdef.h b/flexdef.h index 2f887f4..8e99bb8 100644 --- a/flexdef.h +++ b/flexdef.h @@ -94,7 +94,7 @@ #endif #ifndef PROTO -#if __STDC__ +#if defined(__STDC__) #define PROTO(proto) proto #else #define PROTO(proto) () diff --git a/flexint.h b/flexint.h index 4088715..60e9127 100644 --- a/flexint.h +++ b/flexint.h @@ -5,7 +5,7 @@ /* C99 systems have . Non-C99 systems may or may not. */ -#if __STDC_VERSION__ >= 199901L +#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. diff --git a/misc.c b/misc.c index 2388437..171a789 100644 --- a/misc.c +++ b/misc.c @@ -629,7 +629,7 @@ Char myesc (array) case 't': return '\t'; -#if __STDC__ +#if defined (__STDC__) case 'a': return '\a'; case 'v': @@ -835,7 +835,7 @@ char *readable_form (c) case '\t': return "\\t"; -#if __STDC__ +#if defined (__STDC__) case '\a': return "\\a"; case '\v':