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 Moolenaar 2010-06-20 00:34:06 +00:00
parent 9eecb5528b
commit 33ae3dfefd
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=209358

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 *);