]> The Tcpdump Group git mirrors - libpcap/commitdiff
Move the inclusion of config.h to the top of scanner.l. 359/head
authorDaniel Miller <[email protected]>
Thu, 5 Jun 2014 20:02:55 +0000 (20:02 +0000)
committerDaniel Miller <[email protected]>
Thu, 5 Jun 2014 20:02:55 +0000 (20:02 +0000)
This works around _LARGE_FILES difficulties on AIX. See
http://seclists.org/nmap-dev/2012/q1/459 for example.

Original patch credit David Fifield of the Nmap project
(https://svn.nmap.org/nmap/libpcap/NMAP_MODIFICATIONS/pre-configure.patch)

scanner.l

index a247c993fb75311a3aeb531b5e50bb432e408372..764f7cb5f2a69a0eaba7af602e3388390b8a3b6b 100644 (file)
--- a/scanner.l
+++ b/scanner.l
@@ -1,3 +1,10 @@
+%top{
+/* Must come first for _LARGE_FILE_API on AIX. */
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+}
+
 %{
 /*
  * Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997
  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  */
 
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
 #ifdef WIN32
 #include <pcap-stdinc.h>
 #else /* WIN32 */