summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmil Velikov <emil.l.velikov@gmail.com>2014-07-27 14:46:45 +0100
committerEmil Velikov <emil.l.velikov@gmail.com>2014-09-01 16:06:01 +0100
commit8e93afc9765f1de613c65a76e9a86e17db96e653 (patch)
tree55d1f95367e5e515bacab3c34c64b1d462f94070
parent391bba9c4cd2825eadaa648df10e3d1c99c66e80 (diff)
all: include config.h only when available and use its defines
... rather than explicitly redefining HAVE_STDINT_H and _GNU_SOURCE. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
-rw-r--r--intel/test_decode.c5
-rw-r--r--libkms/api.c2
-rw-r--r--libkms/dumb.c4
-rw-r--r--libkms/exynos.c4
-rw-r--r--libkms/intel.c4
-rw-r--r--libkms/linux.c2
-rw-r--r--libkms/nouveau.c4
-rw-r--r--libkms/radeon.c4
-rw-r--r--libkms/vmwgfx.c4
-rw-r--r--tests/drmstat.c2
-rw-r--r--tests/modetest/buffers.c2
-rw-r--r--tests/modetest/cursor.c2
-rw-r--r--tests/modetest/modetest.c2
-rw-r--r--tests/vbltest/vbltest.c2
14 files changed, 35 insertions, 8 deletions
diff --git a/intel/test_decode.c b/intel/test_decode.c
index b710f342..bef9d99f 100644
--- a/intel/test_decode.c
+++ b/intel/test_decode.c
@@ -21,7 +21,9 @@
* IN THE SOFTWARE.
*/
-#define _GNU_SOURCE
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
#include <string.h>
#include <stdlib.h>
@@ -33,7 +35,6 @@
#include <sys/mman.h>
#include <err.h>
-#include "config.h"
#include "intel_bufmgr.h"
#include "intel_chipset.h"
diff --git a/libkms/api.c b/libkms/api.c
index 5befaa0f..b512c42d 100644
--- a/libkms/api.c
+++ b/libkms/api.c
@@ -26,7 +26,9 @@
**************************************************************************/
+#ifdef HAVE_CONFIG_H
#include "config.h"
+#endif
#include <errno.h>
#include <stdlib.h>
#include <string.h>
diff --git a/libkms/dumb.c b/libkms/dumb.c
index 440efb31..794282fb 100644
--- a/libkms/dumb.c
+++ b/libkms/dumb.c
@@ -26,7 +26,9 @@
**************************************************************************/
-#define HAVE_STDINT_H
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
#define _FILE_OFFSET_BITS 64
#include <errno.h>
diff --git a/libkms/exynos.c b/libkms/exynos.c
index 93e36a12..243915b5 100644
--- a/libkms/exynos.c
+++ b/libkms/exynos.c
@@ -11,7 +11,9 @@
* option) any later version.
*/
-#define HAVE_STDINT_H
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
#define _FILE_OFFSET_BITS 64
#include <errno.h>
diff --git a/libkms/intel.c b/libkms/intel.c
index abae4525..92f1cf25 100644
--- a/libkms/intel.c
+++ b/libkms/intel.c
@@ -26,7 +26,9 @@
**************************************************************************/
-#define HAVE_STDINT_H
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
#define _FILE_OFFSET_BITS 64
#include <errno.h>
diff --git a/libkms/linux.c b/libkms/linux.c
index 9b4f29e1..17e1d588 100644
--- a/libkms/linux.c
+++ b/libkms/linux.c
@@ -30,7 +30,9 @@
*/
+#ifdef HAVE_CONFIG_H
#include "config.h"
+#endif
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/libkms/nouveau.c b/libkms/nouveau.c
index 608092f5..2de827d9 100644
--- a/libkms/nouveau.c
+++ b/libkms/nouveau.c
@@ -26,7 +26,9 @@
**************************************************************************/
-#define HAVE_STDINT_H
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
#define _FILE_OFFSET_BITS 64
#include <errno.h>
diff --git a/libkms/radeon.c b/libkms/radeon.c
index f5e382ae..29375c4c 100644
--- a/libkms/radeon.c
+++ b/libkms/radeon.c
@@ -26,7 +26,9 @@
**************************************************************************/
-#define HAVE_STDINT_H
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
#define _FILE_OFFSET_BITS 64
#include <errno.h>
diff --git a/libkms/vmwgfx.c b/libkms/vmwgfx.c
index d594b3bd..598f383c 100644
--- a/libkms/vmwgfx.c
+++ b/libkms/vmwgfx.c
@@ -26,7 +26,9 @@
**************************************************************************/
-#define HAVE_STDINT_H
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
#define _FILE_OFFSET_BITS 64
#include <errno.h>
diff --git a/tests/drmstat.c b/tests/drmstat.c
index c51cbc6c..5935d07a 100644
--- a/tests/drmstat.c
+++ b/tests/drmstat.c
@@ -28,7 +28,9 @@
*
*/
+#ifdef HAVE_CONFIG_H
#include "config.h"
+#endif
#include <stdio.h>
#include <stdlib.h>
diff --git a/tests/modetest/buffers.c b/tests/modetest/buffers.c
index 8206ce31..29b520de 100644
--- a/tests/modetest/buffers.c
+++ b/tests/modetest/buffers.c
@@ -24,7 +24,9 @@
* IN THE SOFTWARE.
*/
+#ifdef HAVE_CONFIG_H
#include "config.h"
+#endif
#include <assert.h>
#include <errno.h>
diff --git a/tests/modetest/cursor.c b/tests/modetest/cursor.c
index 7077f203..60f240ac 100644
--- a/tests/modetest/cursor.c
+++ b/tests/modetest/cursor.c
@@ -22,7 +22,9 @@
* IN THE SOFTWARE.
*/
+#ifdef HAVE_CONFIG_H
#include "config.h"
+#endif
#include <assert.h>
#include <errno.h>
diff --git a/tests/modetest/modetest.c b/tests/modetest/modetest.c
index 7d436b56..92efb823 100644
--- a/tests/modetest/modetest.c
+++ b/tests/modetest/modetest.c
@@ -37,7 +37,9 @@
* TODO: use cairo to write the mode info on the selected output once
* the mode has been programmed, along with possible test patterns.
*/
+#ifdef HAVE_CONFIG_H
#include "config.h"
+#endif
#include <assert.h>
#include <ctype.h>
diff --git a/tests/vbltest/vbltest.c b/tests/vbltest/vbltest.c
index 2a09d28e..50e29dcd 100644
--- a/tests/vbltest/vbltest.c
+++ b/tests/vbltest/vbltest.c
@@ -37,7 +37,9 @@
* TODO: use cairo to write the mode info on the selected output once
* the mode has been programmed, along with possible test patterns.
*/
+#ifdef HAVE_CONFIG_H
#include "config.h"
+#endif
#include <assert.h>
#include <stdio.h>