]> The Tcpdump Group git mirrors - libpcap/commitdiff
Move the inclusion of config.h to the top of scanner.c
authorDaniel Miller <[email protected]>
Fri, 6 Jun 2014 01:16:50 +0000 (01:16 +0000)
committerDaniel Miller <[email protected]>
Fri, 6 Jun 2014 01:16:50 +0000 (01:16 +0000)
This works around _LARGE_FILES difficulties on AIX. See
http://seclists.org/nmap-dev/2012/q1/459 for example.

This is an alternative to the flex-only solution in #359

Makefile.in
scanner.c.top [new file with mode: 0644]
scanner.l

index 1c2d7459943f977ec0874418c743ded5146c529d..ea5059e17bcaab29b53592a752af9c19d7e297a6 100644 (file)
@@ -443,8 +443,9 @@ libpcap.shareda: $(OBJ)
 libpcap.none:
 
 scanner.c: $(srcdir)/scanner.l
-       @rm -f $@
-       $(srcdir)/runlex.sh $(LEX) -o$@ $<
+       @rm -f $@ [email protected]
+       $(srcdir)/runlex.sh $(LEX) [email protected] $<
+       cat [email protected] [email protected] > $@
 
 scanner.o: scanner.c tokdefs.h
        $(CC) $(FULL_CFLAGS) -c scanner.c
diff --git a/scanner.c.top b/scanner.c.top
new file mode 100644 (file)
index 0000000..c7cde56
--- /dev/null
@@ -0,0 +1,3 @@
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
index a247c993fb75311a3aeb531b5e50bb432e408372..1666b03bda6e131b4eb1386616aa741c8a0f7bec 100644 (file)
--- a/scanner.l
+++ b/scanner.l
  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  */
 
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
 #ifdef WIN32
 #include <pcap-stdinc.h>
 #else /* WIN32 */