[Pixman] [PATCH 6/7] test: Do not include config.h unless HAVE_CONFIG_H is defined

Andrea Canciani ranma42 at gmail.com
Sun Sep 4 13:53:44 PDT 2011


The win32 build system does not generate config.h and correctly runs
the compiler without defining HAVE_CONFIG_H. Nevertheless some files
include config.h without checking for its availability, breaking the
build from a clean directory:

test\utils.h(2) : fatal error C1083: Cannot open include file:
'config.h': No such file or directory
...
---
 test/blitters-test.c        |    1 -
 test/composite.c            |    1 -
 test/fetch-test.c           |    5 ++++-
 test/pdf-op-test.c          |    1 -
 test/scaling-helpers-test.c |    1 -
 test/utils.h                |    5 ++++-
 6 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/test/blitters-test.c b/test/blitters-test.c
index 594ec54..790a27f 100644
--- a/test/blitters-test.c
+++ b/test/blitters-test.c
@@ -8,7 +8,6 @@
 #include <assert.h>
 #include <stdlib.h>
 #include <stdio.h>
-#include <config.h>
 #include "utils.h"
 
 static pixman_indexed_t rgb_palette[9];
diff --git a/test/composite.c b/test/composite.c
index edea9a9..408c363 100644
--- a/test/composite.c
+++ b/test/composite.c
@@ -27,7 +27,6 @@
 #include <stdio.h>
 #include <stdlib.h> /* abort() */
 #include <math.h>
-#include <config.h>
 #include <time.h>
 #include "utils.h"
 
diff --git a/test/fetch-test.c b/test/fetch-test.c
index feb98d9..9f80eec 100644
--- a/test/fetch-test.c
+++ b/test/fetch-test.c
@@ -1,8 +1,11 @@
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include <assert.h>
 #include <stdlib.h>
 #include <stdio.h>
 #include "pixman.h"
-#include <config.h>
 
 #define SIZE 1024
 
diff --git a/test/pdf-op-test.c b/test/pdf-op-test.c
index dc7a4fd..99cb7df 100644
--- a/test/pdf-op-test.c
+++ b/test/pdf-op-test.c
@@ -1,4 +1,3 @@
-#include <config.h>
 #include <stdlib.h>
 #include "utils.h"
 
diff --git a/test/scaling-helpers-test.c b/test/scaling-helpers-test.c
index eb436d1..a8b94b0 100644
--- a/test/scaling-helpers-test.c
+++ b/test/scaling-helpers-test.c
@@ -1,4 +1,3 @@
-#include <config.h>
 #include <stdint.h>
 #include <stdlib.h>
 #include <stdio.h>
diff --git a/test/utils.h b/test/utils.h
index f0c9c30..7d16a9c 100644
--- a/test/utils.h
+++ b/test/utils.h
@@ -1,5 +1,8 @@
-#include <stdlib.h>
+#ifdef HAVE_CONFIG_H
 #include <config.h>
+#endif
+
+#include <stdlib.h>
 #include <assert.h>
 #include "pixman-private.h" /* For 'inline' definition */
 
-- 
1.7.4.4



More information about the Pixman mailing list