From ed340abc37b07cb9fc788ae77d837088c54cd16a Mon Sep 17 00:00:00 2001 From: Emil Velikov Date: Tue, 10 Feb 2015 14:55:21 +0000 Subject: Include config.h before any other headers. The former has a series of defines which in some cases are crusial to be set before including any system headers. Signed-off-by: Emil Velikov Reviewed-by: Alan Coopersmith Signed-off-by: Alan Coopersmith --- src/common_vgaarb.c | 8 ++++---- src/freebsd_pci.c | 8 ++++---- src/linux_sysfs.c | 8 ++++---- src/netbsd_pci.c | 8 ++++---- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/common_vgaarb.c b/src/common_vgaarb.c index b2e1d8a..7a7d204 100644 --- a/src/common_vgaarb.c +++ b/src/common_vgaarb.c @@ -25,6 +25,10 @@ * */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include #include #include @@ -33,10 +37,6 @@ #include #include -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - #include "pciaccess.h" #include "pciaccess_private.h" diff --git a/src/freebsd_pci.c b/src/freebsd_pci.c index a9304de..f9c1476 100644 --- a/src/freebsd_pci.c +++ b/src/freebsd_pci.c @@ -33,6 +33,10 @@ * \author Eric Anholt */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include #include #include @@ -45,10 +49,6 @@ #include #include -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - #include "pciaccess.h" #include "pciaccess_private.h" diff --git a/src/linux_sysfs.c b/src/linux_sysfs.c index 08c9971..50d94cf 100644 --- a/src/linux_sysfs.c +++ b/src/linux_sysfs.c @@ -34,6 +34,10 @@ #define _GNU_SOURCE +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include #include #include @@ -57,10 +61,6 @@ #define iopl(x) -1 #endif -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - #ifdef HAVE_MTRR #include #include diff --git a/src/netbsd_pci.c b/src/netbsd_pci.c index 52591b0..f972f94 100644 --- a/src/netbsd_pci.c +++ b/src/netbsd_pci.c @@ -16,15 +16,15 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include #include #include #include -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - #ifdef HAVE_MTRR #include #include -- cgit v1.2.1