Huge thanks to our Platinum Members Endace and LiveAction,
and our Silver Member Veeam, for supporting the Wireshark Foundation and project.

Ethereal-dev: [Ethereal-dev] patch for using flex 2.5.31

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Gilbert Ramirez <gram@xxxxxxxxxxxxxxx>
Date: Sat, 24 Apr 2004 00:16:06 -0500
This takes care of the problem of using flex 2.5.31 (as is used on Debian 
unstable) for processing epan/dfilter/scanner.l into scanner.c.

Can someone with flex 2.5.4 check that this patch doesn't break your build?

For info, see the history at:
http://www.ethereal.com/lists/ethereal-dev/200304/msg00271.html

--gilbert
Index: epan/dfilter/scanner.l
===================================================================
RCS file: /usr/local/cvsroot/ethereal/epan/dfilter/scanner.l,v
retrieving revision 1.16
diff -u -r1.16 scanner.l
--- epan/dfilter/scanner.l	27 Feb 2004 12:00:30 -0000	1.16
+++ epan/dfilter/scanner.l	24 Apr 2004 05:11:27 -0000
@@ -37,6 +37,7 @@
 #define LVAL_TYPE	stnode_t*
 #define LVAL_INIT_VAL	NULL
 #define MODNAME		df
+#define FLEX_YY_PREFIX	df_
 
 #include <lemonflex-head.inc>
 
Index: tools/lemon/lemonflex-tail.inc
===================================================================
RCS file: /usr/local/cvsroot/ethereal/tools/lemon/lemonflex-tail.inc,v
retrieving revision 1.1
diff -u -r1.1 lemonflex-tail.inc
--- tools/lemon/lemonflex-tail.inc	1 Feb 2001 20:21:25 -0000	1.1
+++ tools/lemon/lemonflex-tail.inc	24 Apr 2004 05:11:28 -0000
@@ -19,6 +19,22 @@
 #define CLEANUP_FUNC	CONCAT(MODNAME,_scanner_cleanup)
 #define WRAP_FUNC	CONCAT(MODNAME,_wrap)
 
+/* flex 2.5.31 no longer #defines these as yy_* if used with -P. */
+#ifndef yy_scan_string
+#define yy_scan_string		CONCAT(FLEX_YY_PREFIX, _scan_string)
+#endif
+
+#ifndef yy_create_buffer
+#define yy_create_buffer	CONCAT(FLEX_YY_PREFIX, _create_buffer)
+#endif
+
+#ifndef yy_switch_to_buffer
+#define yy_switch_to_buffer	CONCAT(FLEX_YY_PREFIX, _switch_to_buffer)
+#endif
+
+#ifndef yy_delete_buffer
+#define yy_delete_buffer	CONCAT(FLEX_YY_PREFIX, _delete_buffer)
+#endif
 
 /* Resets scanner and assigns the char* argument
  * as the text to scan