summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChih-Wei Huang <cwhuang@linux.org.tw>2015-02-10 14:55:20 +0000
committerAlan Coopersmith <alan.coopersmith@oracle.com>2015-02-12 14:10:10 -0800
commit6329ef9e5d6f36ca3f7258279f6640037b71926a (patch)
tree7b13d8f3d059e0625711be7b8b103d7684553861
parente42ee2a075a8b7c62b190815be42ea26c9d8c03f (diff)
Add missing guards around config.h inclusion
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>
-rw-r--r--src/common_vgaarb.c3
-rw-r--r--src/freebsd_pci.c3
-rw-r--r--src/linux_sysfs.c2
3 files changed, 8 insertions, 0 deletions
diff --git a/src/common_vgaarb.c b/src/common_vgaarb.c
index ab3c5e8..b2e1d8a 100644
--- a/src/common_vgaarb.c
+++ b/src/common_vgaarb.c
@@ -33,7 +33,10 @@
#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 7f5f56b..a9304de 100644
--- a/src/freebsd_pci.c
+++ b/src/freebsd_pci.c
@@ -45,7 +45,10 @@
#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 8fca65e..08c9971 100644
--- a/src/linux_sysfs.c
+++ b/src/linux_sysfs.c
@@ -57,7 +57,9 @@
#define iopl(x) -1
#endif
+#ifdef HAVE_CONFIG_H
#include "config.h"
+#endif
#ifdef HAVE_MTRR
#include <asm/mtrr.h>