Always include "config.h" at the start of all C source files.
authorAlan Coopersmith <alan.coopersmith@oracle.com>
Sat, 25 Aug 2012 06:32:32 +0000 (23:32 -0700)
committerAlan Coopersmith <alan.coopersmith@oracle.com>
Sat, 25 Aug 2012 19:34:24 +0000 (12:34 -0700)
Allows configure to set defines such as _POSIX_SOURCE in config.h
that affect functions exposed by system headers and get consistent
results across all the source files.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
src/c_client.py
src/xcb_conn.c
src/xcb_ext.c
src/xcb_in.c
src/xcb_list.c
src/xcb_out.c
src/xcb_util.c
src/xcb_xid.c

index 31ed3b5..27a01b1 100644 (file)
@@ -176,6 +176,9 @@ def c_open(self):
     _h('')
     _h('#include "xcb.h"')
 
+    _c('#ifdef HAVE_CONFIG_H')
+    _c('#include "config.h"')
+    _c('#endif')
     _c('#include <stdlib.h>')
     _c('#include <string.h>')
     _c('#include <assert.h>')
index 725502a..7202cc5 100644 (file)
 
 /* Connection management: the core of XCB. */
 
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
 #include <assert.h>
 #include <string.h>
 #include <stdio.h>
index 68bb29b..831f283 100644 (file)
 
 /* A cache for QueryExtension results. */
 
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
 #include <stdlib.h>
 #include <string.h>
 
index 4998cdd..b810783 100644 (file)
 
 /* Stuff that reads stuff from the server. */
 
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
 #include <assert.h>
 #include <string.h>
 #include <stdlib.h>
index 3a18d90..6f5c611 100644 (file)
 
 /* A generic implementation of a list of void-pointers. */
 
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
 #include <stdlib.h>
 
 #include "xcb.h"
index c0601f2..405f963 100644 (file)
 
 /* Stuff that sends stuff to the server. */
 
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
 #include <assert.h>
 #include <stdlib.h>
 #include <unistd.h>
index 45f66cb..e480d75 100644 (file)
 
 /* Utility functions implementable using only public APIs. */
 
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
 #include <assert.h>
 #include <sys/types.h>
 #include <limits.h>
@@ -51,7 +55,6 @@
 #include "xcbext.h"
 #include "xcbint.h"
 
-/* must be after "xcbint.h" to get autoconf #defines */
 #if defined(HAVE_TSOL_LABEL_H) && defined(HAVE_IS_SYSTEM_LABELED)
 # include <tsol/label.h>
 # include <sys/stat.h>
index 3df5dbe..79a9a27 100644 (file)
 
 /* XID allocators. */
 
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
 #include <assert.h>
 #include <stdlib.h>
 #include "xcb.h"