OSDN Git Service

Add missing guards around config.h inclusion
authorChih-Wei Huang <cwhuang@linux.org.tw>
Tue, 10 Feb 2015 14:55:20 +0000 (14:55 +0000)
committerAlan Coopersmith <alan.coopersmith@oracle.com>
Thu, 12 Feb 2015 22:10:10 +0000 (14:10 -0800)
In some cases the header may not exist, leading to compilation issues.
Add the ifdef HAVE_CONFIG_H, as it is those in other parts of the
project.

[Emil Velikov: Split out from a larger commit, rework commit message]
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>
src/common_vgaarb.c
src/freebsd_pci.c
src/linux_sysfs.c

index ab3c5e8..b2e1d8a 100644 (file)
 #include <stdlib.h>
 #include <limits.h>
 
+#ifdef HAVE_CONFIG_H
 #include "config.h"
+#endif
+
 #include "pciaccess.h"
 #include "pciaccess_private.h"
 
index 7f5f56b..a9304de 100644 (file)
 #include <sys/mman.h>
 #include <sys/memrange.h>
 
+#ifdef HAVE_CONFIG_H
 #include "config.h"
+#endif
+
 #include "pciaccess.h"
 #include "pciaccess_private.h"
 
index 8fca65e..08c9971 100644 (file)
@@ -57,7 +57,9 @@
 #define iopl(x) -1
 #endif
 
+#ifdef HAVE_CONFIG_H
 #include "config.h"
+#endif
 
 #ifdef HAVE_MTRR
 #include <asm/mtrr.h>