Bug 2493: Fix (Part 2):
[obnox/wireshark/wip.git] / epan / dtd_preparse.l
index 988cd8728148cbbf7a41098f2e207cd45be2d773..c73d7227728a9eea582cbcd8381266779e9883da 100644 (file)
@@ -1,8 +1,3 @@
-/*
- * We want to stop processing when we get to the end of the input.
- */
-%option noyywrap
-
 /*
  * We don't use unput, so don't generate code for it.
  */
@@ -82,6 +77,13 @@ static guint linenum;
 static gchar* replace_entity(gchar* s);
 static const gchar* location(void);
 
+/*
+ * Flex (v 2.5.35) uses this symbol to "exclude" unistd.h
+ */
+#ifdef _WIN32
+#define YY_NO_UNISTD_H
+#endif
+
 %}
 xmlpi_start "<?"
 xmlpi_stop  "?>"
@@ -217,3 +219,14 @@ extern GString* dtd_preparse(const gchar* dname,const  gchar* fname, GString* er
 
        return output;
 }
+
+/*
+ * We want to stop processing when we get to the end of the input.
+ * (%option noyywrap is not used because if used then 
+ * some flex versions (eg: 2.5.35) generate code which causes
+ * warnings by the Windows VC compiler).
+ */
+
+int yywrap(void) {
+    return 1;
+}