From 6329ef9e5d6f36ca3f7258279f6640037b71926a Mon Sep 17 00:00:00 2001 From: Chih-Wei Huang Date: Tue, 10 Feb 2015 14:55:20 +0000 Subject: 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 Reviewed-by: Alan Coopersmith Signed-off-by: Alan Coopersmith --- src/common_vgaarb.c | 3 +++ src/freebsd_pci.c | 3 +++ src/linux_sysfs.c | 2 ++ 3 files changed, 8 insertions(+) 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 #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 7f5f56b..a9304de 100644 --- a/src/freebsd_pci.c +++ b/src/freebsd_pci.c @@ -45,7 +45,10 @@ #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 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 -- cgit v1.2.3