aboutsummaryrefslogtreecommitdiffstats
path: root/epan
diff options
context:
space:
mode:
authorBill Meier <wmeier@newsguy.com>2008-04-25 17:40:29 +0000
committerBill Meier <wmeier@newsguy.com>2008-04-25 17:40:29 +0000
commit0d4b874b44dd082eaa61b5b403069d0e3cd38453 (patch)
treec78189b236a540b92d55b797c7ec1bf798db3f76 /epan
parentff523807655f111ba5ae1f84a030ee8a147c3997 (diff)
Bug 2493: Fix (Part 2):
To prevent Windows compiler errors when using flex 2.5.35. Fixes "missing unistd.h" and yywrap "mismatched parameter" warnings [Upcoming Part 3: ignore 'signed /unsigned mismatch' errors] svn path=/trunk/; revision=25173
Diffstat (limited to 'epan')
-rw-r--r--epan/dfilter/scanner.l5
-rw-r--r--epan/diam_dict.l21
-rw-r--r--epan/dtd_parse.l23
-rw-r--r--epan/dtd_preparse.l23
-rw-r--r--epan/radius_dict.l16
-rw-r--r--epan/uat_load.l16
6 files changed, 69 insertions, 35 deletions
diff --git a/epan/dfilter/scanner.l b/epan/dfilter/scanner.l
index 8ce6d91d60..efcf4ce395 100644
--- a/epan/dfilter/scanner.l
+++ b/epan/dfilter/scanner.l
@@ -1,9 +1,4 @@
/*
- * 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.
*/
%option nounput
diff --git a/epan/diam_dict.l b/epan/diam_dict.l
index 1927845689..e6478d5e9a 100644
--- a/epan/diam_dict.l
+++ b/epan/diam_dict.l
@@ -1,14 +1,4 @@
/*
- * 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.
- */
-%option nounput
-
-/*
* We don't read from the terminal.
*/
%option never-interactive
@@ -806,6 +796,17 @@ void ddict_print(FILE* fh, ddict_t* d) {
}
}
+/*
+ * 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;
+}
+
#ifdef TEST_DIAM_DICT_STANDALONE
int main(int argc, char** argv) {
ddict_t* d;
diff --git a/epan/dtd_parse.l b/epan/dtd_parse.l
index 6749dfb556..f097148809 100644
--- a/epan/dtd_parse.l
+++ b/epan/dtd_parse.l
@@ -1,9 +1,4 @@
/*
- * 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.
*/
%option nounput
@@ -111,6 +106,13 @@
#define YY_INPUT(buff,result,max_size) ( (result) = my_yyinput((buff),(max_size)) )
+/*
+ * Flex (v 2.5.35) uses this symbol to "exclude" unistd.h
+ */
+#ifdef _WIN32
+#define YY_NO_UNISTD_H
+#endif
+
%}
comment_start "<!--"
@@ -367,3 +369,14 @@ extern dtd_build_data_t* dtd_parse(GString* s) {
return build_data;
}
+
+/*
+ * 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;
+}
diff --git a/epan/dtd_preparse.l b/epan/dtd_preparse.l
index 988cd87281..c73d722772 100644
--- a/epan/dtd_preparse.l
+++ b/epan/dtd_preparse.l
@@ -1,9 +1,4 @@
/*
- * 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.
*/
%option nounput
@@ -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;
+}
diff --git a/epan/radius_dict.l b/epan/radius_dict.l
index 2dfbcec1dd..677e039123 100644
--- a/epan/radius_dict.l
+++ b/epan/radius_dict.l
@@ -1,9 +1,4 @@
/*
- * 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.
*/
%option nounput
@@ -419,3 +414,14 @@ gboolean radius_load_dictionary (radius_dictionary_t* d, gchar* dir, const gchar
return TRUE;
}
}
+
+/*
+ * 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;
+}
diff --git a/epan/uat_load.l b/epan/uat_load.l
index ec93d11100..1045d8e757 100644
--- a/epan/uat_load.l
+++ b/epan/uat_load.l
@@ -1,9 +1,4 @@
/*
- * 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.
*/
%option nounput
@@ -349,3 +344,14 @@ gboolean uat_load_str(uat_t* uat_in, char* entry, char** err) {
return TRUE;
}
}
+
+/*
+ * 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;
+}