X-Git-Url: http://git.marmaro.de/?a=blobdiff_plain;f=sbr%2Fdtimep.lex;h=29c4dd0c21d4f7aa11eaf9d7aa7504e6f39900cb;hb=13ae9ba066e6b8c114daa6714895a56816465f49;hp=113f2ea2a03d479a35389d69292bd8a426ec563f;hpb=13f84dd50ca5754391dbd3296a5c7425f9363600;p=mmh diff --git a/sbr/dtimep.lex b/sbr/dtimep.lex index 113f2ea..29c4dd0 100644 --- a/sbr/dtimep.lex +++ b/sbr/dtimep.lex @@ -1,3 +1,12 @@ +/* dtimep.lex exceeds the default table capacities for some old versions + * of lex (and the minimum defaults as specified by POSIX). The following + * choices meet or exceed the lex defaults for older SunOS4.x, Solaris, + * HPUX, and AIX. + */ +%e4000 +%p7000 +%n2500 +%a5000 %{ #include #include @@ -8,7 +17,7 @@ #define yywrap() 1 #define YY_SKIP_YYWRAP -#define YY_NO_UNPUT +#define YY_NO_INPUT /* This is the tricky thing that makes this function cool. We * replace the traditional int yylex(void) declaration with our @@ -151,16 +160,10 @@ static int day_map[] = { --cp; } #ifdef ADJUST_NUMERIC_ONLY_TZ_OFFSETS_WRT_DST -# ifdef TIME_WITH_SYS_TIME +# ifdef HAVE_SYS_TIME_H # include -# include -# else -# ifdef HAVE_SYS_TIME_H -# include -# else -# include -# endif # endif +#include static void zonehack (struct tws *tw) @@ -389,3 +392,16 @@ nl [ \t\n()] {nl}("hdt"|"HDT") { INIT(); SETDST(); SETZONE(-1000); yyterminate(); } .|\n + +%% +/* This is a portable way to squash a warning about the yyunput() + * function being static but never used. It costs us a tiny amount + * of extra code in the binary but the other options are: + * "%option nounput" which is flex-specific + * makefile hackery just to compile dtimep.c with different flags + */ +void dtimep_yyunput(int c) +{ + unput(c); +} +