summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmil Velikov <emil.l.velikov@gmail.com>2015-02-10 14:55:21 +0000
committerAlan Coopersmith <alan.coopersmith@oracle.com>2015-02-12 14:10:10 -0800
commited340abc37b07cb9fc788ae77d837088c54cd16a (patch)
treedefbc6afc8e33e3a796607a8c0a969ea36324b02
parent6329ef9e5d6f36ca3f7258279f6640037b71926a (diff)
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 <emil.l.velikov@gmail.com> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r--src/common_vgaarb.c8
-rw-r--r--src/freebsd_pci.c8
-rw-r--r--src/linux_sysfs.c8
-rw-r--r--src/netbsd_pci.c8
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 <stdio.h>
#include <string.h>
#include <unistd.h>
@@ -33,10 +37,6 @@
#include <stdlib.h>
#include <limits.h>
-#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 <eric@anholt.net>
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
@@ -45,10 +49,6 @@
#include <sys/mman.h>
#include <sys/memrange.h>
-#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 <stdlib.h>
#include <string.h>
#include <stdio.h>
@@ -57,10 +61,6 @@
#define iopl(x) -1
#endif
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
#ifdef HAVE_MTRR
#include <asm/mtrr.h>
#include <sys/ioctl.h>
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 <sys/param.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/types.h>
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
#ifdef HAVE_MTRR
#include <machine/sysarch.h>
#include <machine/mtrr.h>