Removed HAVE_STRUCT_TM_TM_GMTOFF support because it didn't work on Cygwin and isn...
[mmh] / sbr / dtimep.lex
index c35c9be..29c4dd0 100644 (file)
@@ -17,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
@@ -160,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 <sys/time.h>
-#  include <time.h>
-# else
-#  ifdef HAVE_SYS_TIME_H
-#   include <sys/time.h>
-#  else
-#   include <time.h>
-#  endif
 # endif
+#include <time.h>
 
 static void
 zonehack (struct tws *tw)
@@ -398,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);
+}
+