From b52790e8ed4bb077eabdeca803935d2910558acc Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Fri, 24 Aug 2012 23:32:32 -0700 Subject: [PATCH] Always include "config.h" at the start of all C source files. 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 --- src/c_client.py | 3 +++ src/xcb_conn.c | 4 ++++ src/xcb_ext.c | 4 ++++ src/xcb_in.c | 4 ++++ src/xcb_list.c | 4 ++++ src/xcb_out.c | 4 ++++ src/xcb_util.c | 5 ++++- src/xcb_xid.c | 4 ++++ 8 files changed, 31 insertions(+), 1 deletion(-) diff --git a/src/c_client.py b/src/c_client.py index 31ed3b5..27a01b1 100644 --- a/src/c_client.py +++ b/src/c_client.py @@ -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 ') _c('#include ') _c('#include ') diff --git a/src/xcb_conn.c b/src/xcb_conn.c index 725502a..7202cc5 100644 --- a/src/xcb_conn.c +++ b/src/xcb_conn.c @@ -25,6 +25,10 @@ /* Connection management: the core of XCB. */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include #include #include diff --git a/src/xcb_ext.c b/src/xcb_ext.c index 68bb29b..831f283 100644 --- a/src/xcb_ext.c +++ b/src/xcb_ext.c @@ -25,6 +25,10 @@ /* A cache for QueryExtension results. */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include #include diff --git a/src/xcb_in.c b/src/xcb_in.c index 4998cdd..b810783 100644 --- a/src/xcb_in.c +++ b/src/xcb_in.c @@ -25,6 +25,10 @@ /* Stuff that reads stuff from the server. */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include #include #include diff --git a/src/xcb_list.c b/src/xcb_list.c index 3a18d90..6f5c611 100644 --- a/src/xcb_list.c +++ b/src/xcb_list.c @@ -25,6 +25,10 @@ /* A generic implementation of a list of void-pointers. */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include #include "xcb.h" diff --git a/src/xcb_out.c b/src/xcb_out.c index c0601f2..405f963 100644 --- a/src/xcb_out.c +++ b/src/xcb_out.c @@ -25,6 +25,10 @@ /* Stuff that sends stuff to the server. */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include #include #include diff --git a/src/xcb_util.c b/src/xcb_util.c index 45f66cb..e480d75 100644 --- a/src/xcb_util.c +++ b/src/xcb_util.c @@ -25,6 +25,10 @@ /* Utility functions implementable using only public APIs. */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include #include #include @@ -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 # include diff --git a/src/xcb_xid.c b/src/xcb_xid.c index 3df5dbe..79a9a27 100644 --- a/src/xcb_xid.c +++ b/src/xcb_xid.c @@ -25,6 +25,10 @@ /* XID allocators. */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include #include #include "xcb.h" -- 2.34.1