From dfbc6e6a57d6da724dda4e0918dac76481330190 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Thu, 27 Nov 2014 00:12:42 +0900 Subject: [PATCH] examples: Guard include config.h with HAVE_CONFIG_H --- examples/client.c | 5 ++++- examples/deflate.c | 3 +++ examples/libevent-client.c | 5 ++++- examples/libevent-server.c | 3 +++ examples/tiny-nghttpd.c | 4 ++++ 5 files changed, 18 insertions(+), 2 deletions(-) diff --git a/examples/client.c b/examples/client.c index a008ba54..54390d93 100644 --- a/examples/client.c +++ b/examples/client.c @@ -26,6 +26,10 @@ * This program is written to show how to use nghttp2 API in C and * intentionally made simple. */ +#ifdef HAVE_CONFIG_H +#include +#endif /* !HAVE_CONFIG_H */ + #include #include #include @@ -40,7 +44,6 @@ #include #include -#include #include #include diff --git a/examples/deflate.c b/examples/deflate.c index 2ca84f7f..2d313ad3 100644 --- a/examples/deflate.c +++ b/examples/deflate.c @@ -22,7 +22,10 @@ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +#ifdef HAVE_CONFIG_H #include +#endif /* !HAVE_CONFIG_H */ + #include #include diff --git a/examples/libevent-client.c b/examples/libevent-client.c index 5dd8e356..235be974 100644 --- a/examples/libevent-client.c +++ b/examples/libevent-client.c @@ -22,8 +22,11 @@ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include +#ifdef HAVE_CONFIG_H #include +#endif /* !HAVE_CONFIG_H */ + +#include #include #include #include diff --git a/examples/libevent-server.c b/examples/libevent-server.c index 7d7ab311..e8a3418a 100644 --- a/examples/libevent-server.c +++ b/examples/libevent-server.c @@ -22,7 +22,10 @@ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +#ifdef HAVE_CONFIG_H #include +#endif /* !HAVE_CONFIG_H */ + #include #include #include diff --git a/examples/tiny-nghttpd.c b/examples/tiny-nghttpd.c index d7d6dc27..f2e308e5 100644 --- a/examples/tiny-nghttpd.c +++ b/examples/tiny-nghttpd.c @@ -27,7 +27,11 @@ * overhead of underlying I/O library (e.g., libevent, Boost ASIO). */ #define _GNU_SOURCE + +#ifdef HAVE_CONFIG_H #include +#endif /* !HAVE_CONFIG_H */ + #include #include #include