Implicitly include config.h in all files The definitions in config.h should be available in all files an implementation detail; it can be included through the build system instead of having each file pull it every time. This is especially helpful with AC_USE_SYSTEM_EXTENSIONS, as _GNU_SOURCE and friends can have an effect by merely being defined, which can lead to some confusion if its effective for only half the files. And we don't really support a build _without_ config.h; so, one less thing to worry about. Signed-off-by: Ran Benita <ran234@gmail.com>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175
diff --git a/Makefile.am b/Makefile.am
index 6aa5b8e..0564a7c 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -22,7 +22,8 @@ AM_CPPFLAGS = \
-I$(top_srcdir)/include \
-I$(top_srcdir)/src \
-I$(top_srcdir)/src/xkbcomp \
- -Isrc/xkbcomp
+ -Isrc/xkbcomp/ \
+ -include $(top_srcdir)/src/config.h
AM_CFLAGS = \
$(BASE_CFLAGS) \
diff --git a/src/alloc.c b/src/alloc.c
index a2a1330..91b010b 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -23,9 +23,6 @@ OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
#include "utils.h"
#include "xkballoc.h"
#include "xkbcommon/xkbcommon.h"
diff --git a/src/atom.c b/src/atom.c
index d4076c4..181744d 100644
--- a/src/atom.c
+++ b/src/atom.c
@@ -70,9 +70,6 @@ SOFTWARE.
********************************************************/
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
#include "xkbmisc.h"
#include "xkbcommon/xkbcommon.h"
#include "XKBcommonint.h"
diff --git a/src/context.c b/src/context.c
index 8878b16..9acb416 100644
--- a/src/context.c
+++ b/src/context.c
@@ -23,10 +23,6 @@
* Author: Daniel Stone <daniel@fooishbar.org>
*/
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
#include <sys/types.h>
#include <sys/stat.h>
#include <stdio.h>
diff --git a/src/keysym.c b/src/keysym.c
index 8f6515d..5079419 100644
--- a/src/keysym.c
+++ b/src/keysym.c
@@ -25,9 +25,6 @@ sale, use or other dealings in this Software without prior written
authorization from the authors.
*/
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
diff --git a/src/map.c b/src/map.c
index f41beb4..c82fb61 100644
--- a/src/map.c
+++ b/src/map.c
@@ -49,10 +49,6 @@
*
* ********************************************************/
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
#include "utils.h"
#include "xkbcommon/xkbcommon.h"
#include "XKBcommonint.h"
diff --git a/src/maprules.c b/src/maprules.c
index 6a6e616..dd80bd3 100644
--- a/src/maprules.c
+++ b/src/maprules.c
@@ -24,9 +24,6 @@
********************************************************/
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
#include "utils.h"
#include "xkbrules.h"
#include "xkbcommon/xkbcommon.h"
diff --git a/src/misc.c b/src/misc.c
index f0e4546..90c00bb 100644
--- a/src/misc.c
+++ b/src/misc.c
@@ -24,12 +24,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
********************************************************/
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <X11/X.h>
-
#include "xkballoc.h"
#include "xkbmisc.h"
#include "xkbcommon/xkbcommon.h"
diff --git a/src/state.c b/src/state.c
index 2feaeb5..45820b6 100644
--- a/src/state.c
+++ b/src/state.c
@@ -58,10 +58,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
* - messages (very unlikely)
*/
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
#include <assert.h>
#include "xkbcommon/xkbcommon.h"
diff --git a/src/text.c b/src/text.c
index dd755ea..e4f74b3 100644
--- a/src/text.c
+++ b/src/text.c
@@ -24,9 +24,6 @@
********************************************************/
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
#include "xkbmisc.h"
#include "xkbcommon/xkbcommon.h"
#include "XKBcommonint.h"
diff --git a/src/utils.h b/src/utils.h
index 630fa48..01c6ba4 100644
--- a/src/utils.h
+++ b/src/utils.h
@@ -33,10 +33,6 @@
#include <X11/Xdefs.h>
#include <X11/Xfuncproto.h>
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
extern void *
recalloc(void *ptr, size_t old_size, size_t new_size);
diff --git a/src/xkb.c b/src/xkb.c
index 5336885..7a7daf6 100644
--- a/src/xkb.c
+++ b/src/xkb.c
@@ -24,9 +24,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
********************************************************/
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
#include <stdio.h>
#include "xkbmisc.h"