From: Daniel Miller Date: Thu, 5 Jun 2014 20:02:55 +0000 (+0000) Subject: Move the inclusion of config.h to the top of scanner.l. X-Git-Tag: libpcap-1.8.0-bp~159^2^2 X-Git-Url: https://git.tcpdump.org/libpcap/commitdiff_plain/e9f1a5591c3d449ee1a1558fae9a1ada5bd52ba9 Move the inclusion of config.h to the top of scanner.l. 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) --- diff --git a/scanner.l b/scanner.l index a247c993..764f7cb5 100644 --- 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 @@ -20,10 +27,6 @@ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - #ifdef WIN32 #include #else /* WIN32 */