From: Daniel Miller Date: Fri, 6 Jun 2014 01:16:50 +0000 (+0000) Subject: Move the inclusion of config.h to the top of scanner.c X-Git-Tag: libpcap-1.7.2^2~36^2~1 X-Git-Url: https://git.tcpdump.org/libpcap/commitdiff_plain/1dcc0d42a4afa488022d984db25db3cdae6b590a?ds=sidebyside Move the inclusion of config.h to the top of scanner.c 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 --- diff --git a/Makefile.in b/Makefile.in index 1c2d7459..ea5059e1 100644 --- a/Makefile.in +++ b/Makefile.in @@ -443,8 +443,9 @@ libpcap.shareda: $(OBJ) libpcap.none: scanner.c: $(srcdir)/scanner.l - @rm -f $@ - $(srcdir)/runlex.sh $(LEX) -o$@ $< + @rm -f $@ $@.bottom + $(srcdir)/runlex.sh $(LEX) -o$@.bottom $< + cat $@.top $@.bottom > $@ 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 index 00000000..c7cde56c --- /dev/null +++ b/scanner.c.top @@ -0,0 +1,3 @@ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif diff --git a/scanner.l b/scanner.l index a247c993..1666b03b 100644 --- a/scanner.l +++ b/scanner.l @@ -20,10 +20,6 @@ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - #ifdef WIN32 #include #else /* WIN32 */