Unbreak platforms with char unsigned by default. Oddly enough, GCC isn't

satisfied with a simple cast to int in the check against EOF, so the fix
is a bit involved by actually having to go through a temporary variable.
This commit is contained in:
marcel 2010-06-20 00:34:06 +00:00
parent a8e27bd6d3
commit 47a2bcbced

View File

@ -67,8 +67,12 @@
* for all subsequent invocations, which is the effect desired.
*/
#undef unput
#define unput(c) \
if (c != EOF) yyunput( c, yytext_ptr )
#define unput(c) \
do { \
int _c = c; \
if (_c != EOF) \
yyunput(_c, yytext_ptr); \
} while(0)
#endif
static int id_or_type(const char *);