Implicitly include config.h in all files
authorRan Benita <ran234@gmail.com>
Fri, 6 Apr 2012 00:12:50 +0000 (03:12 +0300)
committerDaniel Stone <daniel@fooishbar.org>
Mon, 9 Apr 2012 13:16:17 +0000 (14:16 +0100)
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>
12 files changed:
Makefile.am
src/alloc.c
src/atom.c
src/context.c
src/keysym.c
src/map.c
src/maprules.c
src/misc.c
src/state.c
src/text.c
src/utils.h
src/xkb.c

index 6aa5b8e..0564a7c 100644 (file)
@@ -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) \
index a2a1330..91b010b 100644 (file)
@@ -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"
index d4076c4..181744d 100644 (file)
@@ -70,9 +70,6 @@ SOFTWARE.
 
  ********************************************************/
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
 #include "xkbmisc.h"
 #include "xkbcommon/xkbcommon.h"
 #include "XKBcommonint.h"
index 8878b16..9acb416 100644 (file)
  * 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>
index 8f6515d..5079419 100644 (file)
@@ -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>
index f41beb4..c82fb61 100644 (file)
--- a/src/map.c
+++ b/src/map.c
  *
  * ********************************************************/
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
 #include "utils.h"
 #include "xkbcommon/xkbcommon.h"
 #include "XKBcommonint.h"
index 6a6e616..dd80bd3 100644 (file)
@@ -24,9 +24,6 @@
 
  ********************************************************/
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
 #include "utils.h"
 #include "xkbrules.h"
 #include "xkbcommon/xkbcommon.h"
index f0e4546..90c00bb 100644 (file)
@@ -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"
index 2feaeb5..45820b6 100644 (file)
@@ -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"
index dd755ea..e4f74b3 100644 (file)
@@ -24,9 +24,6 @@
 
  ********************************************************/
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
 #include "xkbmisc.h"
 #include "xkbcommon/xkbcommon.h"
 #include "XKBcommonint.h"
index 630fa48..01c6ba4 100644 (file)
 #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);
 
index 5336885..7a7daf6 100644 (file)
--- 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"