From 38cfc5c47cd270c15b978f8033962289d503a7aa Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Wed, 13 May 2015 22:30:35 +0900 Subject: [PATCH] Check more headers and funcs --- configure.ac | 75 +++++++++++++++++++----- examples/asio-sv2.cc | 4 ++ examples/client.c | 12 +++- examples/libevent-client.c | 8 ++- examples/libevent-server.c | 12 +++- examples/tiny-nghttpd.c | 14 ++++- src/HttpServer.cc | 12 ++++ src/app_helper.cc | 10 ++++ src/app_helper.h | 2 + src/buffer_test.h | 4 ++ src/deflatehd.cc | 2 + src/h2load.cc | 4 ++ src/h2load.h | 4 ++ src/http2_test.h | 4 ++ src/inflatehd.cc | 2 + src/memchunk_test.h | 4 ++ src/nghttp.cc | 6 ++ src/nghttp.h | 4 ++ src/nghttp2_gzip_test.h | 4 ++ src/nghttpd.cc | 2 + src/shrpx-unittest.cc | 2 +- src/shrpx.cc | 16 +++++ src/shrpx.h | 2 + src/shrpx_accept_handler.cc | 2 + src/shrpx_client_handler.cc | 2 + src/shrpx_config.cc | 10 ++++ src/shrpx_config.h | 6 ++ src/shrpx_config_test.cc | 2 + src/shrpx_config_test.h | 4 ++ src/shrpx_connection.cc | 2 + src/shrpx_connection_handler.cc | 2 + src/shrpx_connection_handler.h | 2 + src/shrpx_downstream_test.h | 4 ++ src/shrpx_http2_downstream_connection.cc | 2 + src/shrpx_http2_session.cc | 2 + src/shrpx_log.cc | 6 ++ src/shrpx_ssl.cc | 4 ++ src/shrpx_ssl_test.h | 4 ++ src/shrpx_worker.cc | 2 + src/timegm.h | 2 + src/util.cc | 12 ++++ src/util.h | 4 ++ src/util_test.h | 4 ++ 43 files changed, 266 insertions(+), 21 deletions(-) diff --git a/configure.ac b/configure.ac index 5d349cb3..efff6ece 100644 --- a/configure.ac +++ b/configure.ac @@ -26,8 +26,25 @@ dnl http://www.gnu.org/software/automake/manual/html_node/Flag-Variables-Orderin AC_PREREQ(2.61) AC_INIT([nghttp2], [0.7.15-DEV], [t-tujikawa@users.sourceforge.net]) +AC_USE_SYSTEM_EXTENSIONS + LT_PREREQ([2.2.6]) LT_INIT() + +AC_CANONICAL_BUILD +AC_CANONICAL_HOST +AC_CANONICAL_TARGET + +AM_INIT_AUTOMAKE([subdir-objects]) +# comment out for now since this requires automake 1.13 or higher and +# travis has older one. +# AM_EXTRA_RECURSIVE_TARGETS([it]) + +m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) + +AC_CONFIG_MACRO_DIR([m4]) +AC_CONFIG_HEADERS([config.h]) + dnl See versioning rule: dnl http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html AC_SUBST(LT_CURRENT, 13) @@ -42,21 +59,6 @@ PACKAGE_VERSION_NUM=`printf "0x%02x%02x%02x" "$major" "$minor" "$patch"` AC_SUBST(PACKAGE_VERSION_NUM) -AC_CANONICAL_BUILD -AC_CANONICAL_HOST -AC_CANONICAL_TARGET - -AC_CONFIG_MACRO_DIR([m4]) - -AM_INIT_AUTOMAKE([subdir-objects]) -# comment out for now since this requires automake 1.13 or higher and -# travis has older one. -# AM_EXTRA_RECURSIVE_TARGETS([it]) - -m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) - -AC_CONFIG_HEADERS([config.h]) - dnl Checks for command-line options AC_ARG_ENABLE([werror], [AS_HELP_STRING([--enable-werror], @@ -129,10 +131,13 @@ AC_ARG_VAR([CYTHON], [the Cython executable]) dnl Checks for programs AC_PROG_CC AC_PROG_CXX +AC_PROG_CPP AC_PROG_INSTALL AC_PROG_LN_S AC_PROG_MAKE_SET -AM_PROG_CC_C_O +AC_PROG_RANLIB +AC_PROG_MKDIR_P + PKG_PROG_PKG_CONFIG([0.20]) if [test "x$request_python_bindings" != "xno"]; then @@ -498,12 +503,19 @@ AM_CONDITIONAL([ENABLE_FAILMALLOC], [ test "x${enable_failmalloc}" = "xyes" ]) AC_HEADER_ASSERT AC_CHECK_HEADERS([ \ arpa/inet.h \ + fcntl.h \ + inttypes.h \ + limits.h \ + netdb.h \ netinet/in.h \ pwd.h \ stddef.h \ stdint.h \ stdlib.h \ string.h \ + sys/socket.h \ + sys/time.h \ + syslog.h \ time.h \ unistd.h \ ]) @@ -515,8 +527,17 @@ AC_TYPE_UINT8_T AC_TYPE_UINT16_T AC_TYPE_UINT32_T AC_TYPE_UINT64_T +AC_TYPE_INT8_T +AC_TYPE_INT16_T +AC_TYPE_INT32_T +AC_TYPE_INT64_T +AC_TYPE_OFF_T +AC_TYPE_PID_T +AC_TYPE_UID_T AC_CHECK_TYPES([ptrdiff_t]) +AC_CHECK_HEADER_STDBOOL AC_C_BIGENDIAN +AC_C_INLINE AC_SYS_LARGEFILE AC_CHECK_MEMBER([struct tm.tm_gmtoff], [have_struct_tm_tm_gmtoff=yes], @@ -535,12 +556,34 @@ AC_CHECK_SIZEOF([int *]) if test "x$cross_compiling" != "xyes"; then AC_FUNC_MALLOC fi + +AC_FUNC_CHOWN +AC_FUNC_ERROR_AT_LINE +AC_FUNC_FORK +# Don't check realloc, since LeakSanitizer detects memory leak during check +# AC_FUNC_REALLOC +AC_FUNC_STRERROR_R +AC_FUNC_STRNLEN + AC_CHECK_FUNCS([ \ _Exit \ accept4 \ + dup2 \ + getcwd \ getpwnam \ + localtime_r \ + memchr \ memmove \ memset \ + socket \ + sqrt \ + strchr \ + strdup \ + strerror \ + strndup \ + strstr \ + strtol \ + strtoul \ timegm \ ]) diff --git a/examples/asio-sv2.cc b/examples/asio-sv2.cc index 6cc2d5c0..8d2580ed 100644 --- a/examples/asio-sv2.cc +++ b/examples/asio-sv2.cc @@ -35,8 +35,12 @@ // #include #include +#ifdef HAVE_UNISTD_H #include +#endif // HAVE_UNISTD_H +#ifdef HAVE_FCNTL_H #include +#endif // HAVE_FCNTL_H #include #include diff --git a/examples/client.c b/examples/client.c index 314efb34..b2680f61 100644 --- a/examples/client.c +++ b/examples/client.c @@ -28,16 +28,26 @@ */ #ifdef HAVE_CONFIG_H #include -#endif /* !HAVE_CONFIG_H */ +#endif /* HAVE_CONFIG_H */ #include #include +#ifdef HAVE_UNISTD_H #include +#endif /* HAVE_UNISTD_H */ +#ifdef HAVE_FCNTL_H #include +#endif /* HAVE_FCNTL_H */ #include +#ifdef HAVE_SYS_SOCKET_H #include +#endif /* HAVE_SYS_SOCKET_H */ +#ifdef HAVE_NETDB_H #include +#endif /* HAVE_NETDB_H */ +#ifdef HAVE_NETINET_IN_H #include +#endif /* HAVE_NETINET_IN_H */ #include #include #include diff --git a/examples/libevent-client.c b/examples/libevent-client.c index af60fb3b..019254c0 100644 --- a/examples/libevent-client.c +++ b/examples/libevent-client.c @@ -24,12 +24,18 @@ */ #ifdef HAVE_CONFIG_H #include -#endif /* !HAVE_CONFIG_H */ +#endif /* HAVE_CONFIG_H */ #include +#ifdef HAVE_UNISTD_H #include +#endif /* HAVE_UNISTD_H */ +#ifdef HAVE_SYS_SOCKET_H #include +#endif /* HAVE_SYS_SOCKET_H */ +#ifdef HAVE_NETINET_IN_H #include +#endif /* HAVE_NETINET_IN_H */ #include #include #include diff --git a/examples/libevent-server.c b/examples/libevent-server.c index 9746f234..05a24bbc 100644 --- a/examples/libevent-server.c +++ b/examples/libevent-server.c @@ -24,17 +24,27 @@ */ #ifdef HAVE_CONFIG_H #include -#endif /* !HAVE_CONFIG_H */ +#endif /* HAVE_CONFIG_H */ #include +#ifdef HAVE_SYS_SOCKET_H #include +#endif /* HAVE_SYS_SOCKET_H */ +#ifdef HAVE_NETDB_H #include +#endif /* HAVE_NETDB_H */ #include +#ifdef HAVE_UNISTD_H #include +#endif /* HAVE_UNISTD_H */ #include +#ifdef HAVE_FCNTL_H #include +#endif /* HAVE_FCNTL_H */ #include +#ifdef HAVE_NETINET_IN_H #include +#endif /* HAVE_NETINET_IN_H */ #include #include diff --git a/examples/tiny-nghttpd.c b/examples/tiny-nghttpd.c index e11df975..613112fc 100644 --- a/examples/tiny-nghttpd.c +++ b/examples/tiny-nghttpd.c @@ -30,18 +30,30 @@ #ifdef HAVE_CONFIG_H #include -#endif /* !HAVE_CONFIG_H */ +#endif /* HAVE_CONFIG_H */ #include +#ifdef HAVE_SYS_SOCKET_H #include +#endif /* HAVE_SYS_SOCKET_H */ #include +#ifdef HAVE_FCNTL_H #include +#endif /* HAVE_FCNTL_H */ +#ifdef HAVE_NETDB_H #include +#endif /* HAVE_NETDB_H */ +#ifdef HAVE_NETINET_IN_H #include +#endif /* HAVE_NETINET_IN_H */ #include +#ifdef HAVE_UNISTD_H #include +#endif /* HAVE_UNISTD_H */ #include +#ifdef HAVE_TIME_H #include +#endif /* HAVE_TIME_H */ #include #include #include diff --git a/src/HttpServer.cc b/src/HttpServer.cc index bfda4274..03104284 100644 --- a/src/HttpServer.cc +++ b/src/HttpServer.cc @@ -25,13 +25,25 @@ #include "HttpServer.h" #include +#ifdef HAVE_SYS_SOCKET_H #include +#endif // HAVE_SYS_SOCKET_H +#ifdef HAVE_NETDB_H #include +#endif // HAVE_NETDB_H +#ifdef HAVE_UNISTD_H #include +#endif // HAVE_UNISTD_H +#ifdef HAVE_FCNTL_H #include +#endif // HAVE_FCNTL_H +#ifdef HAVE_NETINET_IN_H #include +#endif // HAVE_NETINET_IN_H #include +#ifdef HAVE_ARPA_INET_H #include +#endif // HAVE_ARPA_INET_H #include #include diff --git a/src/app_helper.cc b/src/app_helper.cc index af7653c1..48298b91 100644 --- a/src/app_helper.cc +++ b/src/app_helper.cc @@ -23,11 +23,21 @@ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include +#ifdef HAVE_SYS_SOCKET_H #include +#endif // HAVE_SYS_SOCKET_H +#ifdef HAVE_NETDB_H #include +#endif // HAVE_NETDB_H +#ifdef HAVE_UNISTD_H #include +#endif // HAVE_UNISTD_H +#ifdef HAVE_FCNTL_H #include +#endif // HAVE_FCNTL_H +#ifdef HAVE_NETINET_IN_H #include +#endif // HAVE_NETINET_IN_H #include #include diff --git a/src/app_helper.h b/src/app_helper.h index 6675fde5..14aba711 100644 --- a/src/app_helper.h +++ b/src/app_helper.h @@ -29,7 +29,9 @@ #include #include +#ifdef HAVE_SYS_TIME_H #include +#endif // HAVE_SYS_TIME_H #include #include diff --git a/src/buffer_test.h b/src/buffer_test.h index d1a889b5..abdc9879 100644 --- a/src/buffer_test.h +++ b/src/buffer_test.h @@ -25,6 +25,10 @@ #ifndef BUFFER_TEST_H #define BUFFER_TEST_H +#ifdef HAVE_CONFIG_H +#include +#endif // HAVE_CONFIG_H + namespace nghttp2 { void test_buffer_write(void); diff --git a/src/deflatehd.cc b/src/deflatehd.cc index dd67ebdb..cd0c5d59 100644 --- a/src/deflatehd.cc +++ b/src/deflatehd.cc @@ -26,7 +26,9 @@ #include #endif // HAVE_CONFIG_H +#ifdef HAVE_UNISTD_H #include +#endif // HAVE_UNISTD_H #include #include diff --git a/src/h2load.cc b/src/h2load.cc index 4c695334..55784156 100644 --- a/src/h2load.cc +++ b/src/h2load.cc @@ -26,10 +26,14 @@ #include #include +#ifdef HAVE_NETINET_IN_H #include +#endif // HAVE_NETINET_IN_H #include #include +#ifdef HAVE_FCNTL_H #include +#endif // HAVE_FCNTL_H #include #include diff --git a/src/h2load.h b/src/h2load.h index 15d071ba..78a20389 100644 --- a/src/h2load.h +++ b/src/h2load.h @@ -28,8 +28,12 @@ #include "nghttp2_config.h" #include +#ifdef HAVE_SYS_SOCKET_H #include +#endif // HAVE_SYS_SOCKET_H +#ifdef HAVE_NETDB_H #include +#endif // HAVE_NETDB_H #include #include diff --git a/src/http2_test.h b/src/http2_test.h index 1171b926..36c5a59a 100644 --- a/src/http2_test.h +++ b/src/http2_test.h @@ -25,6 +25,10 @@ #ifndef SHRPX_HTTP2_TEST_H #define SHRPX_HTTP2_TEST_H +#ifdef HAVE_CONFIG_H +#include +#endif // HAVE_CONFIG_H + namespace shrpx { void test_http2_add_header(void); diff --git a/src/inflatehd.cc b/src/inflatehd.cc index 353941af..37077e85 100644 --- a/src/inflatehd.cc +++ b/src/inflatehd.cc @@ -26,7 +26,9 @@ #include #endif // HAVE_CONFIG_H +#ifdef HAVE_UNISTD_H #include +#endif // HAVE_UNISTD_H #include #include diff --git a/src/memchunk_test.h b/src/memchunk_test.h index 31e2665c..9d170a43 100644 --- a/src/memchunk_test.h +++ b/src/memchunk_test.h @@ -25,6 +25,10 @@ #ifndef MEMCHUNK_TEST_H #define MEMCHUNK_TEST_H +#ifdef HAVE_CONFIG_H +#include +#endif // HAVE_CONFIG_H + namespace nghttp2 { void test_pool_recycle(void); diff --git a/src/nghttp.cc b/src/nghttp.cc index 49e1825b..d8c3a58c 100644 --- a/src/nghttp.cc +++ b/src/nghttp.cc @@ -25,9 +25,15 @@ #include "nghttp.h" #include +#ifdef HAVE_UNISTD_H #include +#endif // HAVE_UNISTD_H +#ifdef HAVE_FCNTL_H #include +#endif // HAVE_FCNTL_H +#ifdef HAVE_NETINET_IN_H #include +#endif // HAVE_NETINET_IN_H #include #include diff --git a/src/nghttp.h b/src/nghttp.h index 67e94722..0a7ee351 100644 --- a/src/nghttp.h +++ b/src/nghttp.h @@ -28,8 +28,12 @@ #include "nghttp2_config.h" #include +#ifdef HAVE_SYS_SOCKET_H #include +#endif // HAVE_SYS_SOCKET_H +#ifdef HAVE_NETDB_H #include +#endif // HAVE_NETDB_H #include #include diff --git a/src/nghttp2_gzip_test.h b/src/nghttp2_gzip_test.h index ff2598d5..2defcdc8 100644 --- a/src/nghttp2_gzip_test.h +++ b/src/nghttp2_gzip_test.h @@ -25,6 +25,10 @@ #ifndef NGHTTP2_GZIP_TEST_H #define NGHTTP2_GZIP_TEST_H +#ifdef HAVE_CONFIG_H +#include +#endif /* HAVE_CONFIG_H */ + #ifdef __cplusplus extern "C" { #endif diff --git a/src/nghttpd.cc b/src/nghttpd.cc index 83b26a48..4ffc0bc9 100644 --- a/src/nghttpd.cc +++ b/src/nghttpd.cc @@ -24,7 +24,9 @@ */ #include "nghttp2_config.h" +#ifdef HAVE_UNISTD_H #include +#endif // HAVE_UNISTD_H #include #include diff --git a/src/shrpx-unittest.cc b/src/shrpx-unittest.cc index 34428e07..86edb1e0 100644 --- a/src/shrpx-unittest.cc +++ b/src/shrpx-unittest.cc @@ -24,7 +24,7 @@ */ #ifdef HAVE_CONFIG_H #include -#endif /* HAVE_CONFIG_H */ +#endif // HAVE_CONFIG_H #include #include diff --git a/src/shrpx.cc b/src/shrpx.cc index 49593e45..2cb2cc59 100644 --- a/src/shrpx.cc +++ b/src/shrpx.cc @@ -27,19 +27,35 @@ #include #include #include +#ifdef HAVE_SYS_SOCKET_H #include +#endif // HAVE_SYS_SOCKET_H #include +#ifdef HAVE_NETDB_H #include +#endif // HAVE_NETDB_H #include +#ifdef HAVE_NETINET_IN_H #include +#endif // HAVE_NETINET_IN_H #include +#ifdef HAVE_ARPA_INET_H #include +#endif // HAVE_ARPA_INET_H +#ifdef HAVE_UNISTD_H #include +#endif // HAVE_UNISTD_H #include +#ifdef HAVE_SYSLOG_H #include +#endif // HAVE_SYSLOG_H #include +#ifdef HAVE_LIMITS_H #include +#endif // HAVE_LIMITS_H +#ifdef HAVE_SYS_TIME_H #include +#endif // HAVE_SYS_TIME_H #include #include diff --git a/src/shrpx.h b/src/shrpx.h index 85c4d343..bd91c766 100644 --- a/src/shrpx.h +++ b/src/shrpx.h @@ -30,7 +30,9 @@ #endif // HAVE_CONFIG_H #include +#ifdef HAVE_SYS_SOCKET_H #include +#endif // HAVE_SYS_SOCKET_H #include diff --git a/src/shrpx_accept_handler.cc b/src/shrpx_accept_handler.cc index d69a05cc..0d448306 100644 --- a/src/shrpx_accept_handler.cc +++ b/src/shrpx_accept_handler.cc @@ -24,7 +24,9 @@ */ #include "shrpx_accept_handler.h" +#ifdef HAVE_UNISTD_H #include +#endif // HAVE_UNISTD_H #include diff --git a/src/shrpx_client_handler.cc b/src/shrpx_client_handler.cc index 1d66e2e3..51e0b524 100644 --- a/src/shrpx_client_handler.cc +++ b/src/shrpx_client_handler.cc @@ -24,7 +24,9 @@ */ #include "shrpx_client_handler.h" +#ifdef HAVE_UNISTD_H #include +#endif // HAVE_UNISTD_H #include #include "shrpx_upstream.h" diff --git a/src/shrpx_config.cc b/src/shrpx_config.cc index 9e0ac424..6577343d 100644 --- a/src/shrpx_config.cc +++ b/src/shrpx_config.cc @@ -24,13 +24,23 @@ */ #include "shrpx_config.h" +#ifdef HAVE_PWD_H #include +#endif // HAVE_PWD_H +#ifdef HAVE_NETDB_H #include +#endif // HAVE_NETDB_H +#ifdef HAVE_SYSLOG_H #include +#endif // HAVE_SYSLOG_H #include #include +#ifdef HAVE_FCNTL_H #include +#endif // HAVE_FCNTL_H +#ifdef HAVE_UNISTD_H #include +#endif // HAVE_UNISTD_H #include #include diff --git a/src/shrpx_config.h b/src/shrpx_config.h index 4856fb8e..872bf836 100644 --- a/src/shrpx_config.h +++ b/src/shrpx_config.h @@ -29,10 +29,16 @@ #include #include +#ifdef HAVE_SYS_SOCKET_H #include +#endif // HAVE_SYS_SOCKET_H #include +#ifdef HAVE_NETINET_IN_H #include +#endif // HAVE_NETINET_IN_H +#ifdef HAVE_ARPA_INET_H #include +#endif // HAVE_ARPA_INET_H #include #include #include diff --git a/src/shrpx_config_test.cc b/src/shrpx_config_test.cc index e326b4af..ad570bbc 100644 --- a/src/shrpx_config_test.cc +++ b/src/shrpx_config_test.cc @@ -24,7 +24,9 @@ */ #include "shrpx_config_test.h" +#ifdef HAVE_UNISTD_H #include +#endif // HAVE_UNISTD_H #include diff --git a/src/shrpx_config_test.h b/src/shrpx_config_test.h index 9db5d4e3..6d6d0353 100644 --- a/src/shrpx_config_test.h +++ b/src/shrpx_config_test.h @@ -25,6 +25,10 @@ #ifndef SHRPX_CONFIG_TEST_H #define SHRPX_CONFIG_TEST_H +#ifdef HAVE_CONFIG_H +#include +#endif // HAVE_CONFIG_H + namespace shrpx { void test_shrpx_config_parse_config_str_list(void); diff --git a/src/shrpx_connection.cc b/src/shrpx_connection.cc index 51a5d39c..88ded529 100644 --- a/src/shrpx_connection.cc +++ b/src/shrpx_connection.cc @@ -24,7 +24,9 @@ */ #include "shrpx_connection.h" +#ifdef HAVE_UNISTD_H #include +#endif // HAVE_UNISTD_H #include diff --git a/src/shrpx_connection_handler.cc b/src/shrpx_connection_handler.cc index 8779779d..ceebf61b 100644 --- a/src/shrpx_connection_handler.cc +++ b/src/shrpx_connection_handler.cc @@ -24,7 +24,9 @@ */ #include "shrpx_connection_handler.h" +#ifdef HAVE_UNISTD_H #include +#endif // HAVE_UNISTD_H #include #include diff --git a/src/shrpx_connection_handler.h b/src/shrpx_connection_handler.h index d8c328c5..00e4be49 100644 --- a/src/shrpx_connection_handler.h +++ b/src/shrpx_connection_handler.h @@ -28,7 +28,9 @@ #include "shrpx.h" #include +#ifdef HAVE_SYS_SOCKET_H #include +#endif // HAVE_SYS_SOCKET_H #include #include diff --git a/src/shrpx_downstream_test.h b/src/shrpx_downstream_test.h index b1e1aee5..67e8f6bd 100644 --- a/src/shrpx_downstream_test.h +++ b/src/shrpx_downstream_test.h @@ -25,6 +25,10 @@ #ifndef SHRPX_DOWNSTREAM_TEST_H #define SHRPX_DOWNSTREAM_TEST_H +#ifdef HAVE_CONFIG_H +#include +#endif // HAVE_CONFIG_H + namespace shrpx { void test_downstream_index_request_headers(void); diff --git a/src/shrpx_http2_downstream_connection.cc b/src/shrpx_http2_downstream_connection.cc index d8d83d73..f5cba83e 100644 --- a/src/shrpx_http2_downstream_connection.cc +++ b/src/shrpx_http2_downstream_connection.cc @@ -24,7 +24,9 @@ */ #include "shrpx_http2_downstream_connection.h" +#ifdef HAVE_UNISTD_H #include +#endif // HAVE_UNISTD_H #include "http-parser/http_parser.h" diff --git a/src/shrpx_http2_session.cc b/src/shrpx_http2_session.cc index 2e8568ed..4fae1f0e 100644 --- a/src/shrpx_http2_session.cc +++ b/src/shrpx_http2_session.cc @@ -25,7 +25,9 @@ #include "shrpx_http2_session.h" #include +#ifdef HAVE_UNISTD_H #include +#endif // HAVE_UNISTD_H #include diff --git a/src/shrpx_log.cc b/src/shrpx_log.cc index 621aad8e..1446df6e 100644 --- a/src/shrpx_log.cc +++ b/src/shrpx_log.cc @@ -24,9 +24,15 @@ */ #include "shrpx_log.h" +#ifdef HAVE_SYSLOG_H #include +#endif // HAVE_SYSLOG_H +#ifdef HAVE_UNISTD_H #include +#endif // HAVE_UNISTD_H +#ifdef HAVE_INTTYPES_H #include +#endif // HAVE_INTTYPES_H #include #include diff --git a/src/shrpx_ssl.cc b/src/shrpx_ssl.cc index cb27749a..b37ad26f 100644 --- a/src/shrpx_ssl.cc +++ b/src/shrpx_ssl.cc @@ -24,8 +24,12 @@ */ #include "shrpx_ssl.h" +#ifdef HAVE_SYS_SOCKET_H #include +#endif // HAVE_SYS_SOCKET_H +#ifdef HAVE_NETDB_H #include +#endif // HAVE_NETDB_H #include #include #include diff --git a/src/shrpx_ssl_test.h b/src/shrpx_ssl_test.h index fbb1fa62..89b00449 100644 --- a/src/shrpx_ssl_test.h +++ b/src/shrpx_ssl_test.h @@ -25,6 +25,10 @@ #ifndef SHRPX_SSL_TEST_H #define SHRPX_SSL_TEST_H +#ifdef HAVE_CONFIG_H +#include +#endif // HAVE_CONFIG_H + namespace shrpx { void test_shrpx_ssl_create_lookup_tree(void); diff --git a/src/shrpx_worker.cc b/src/shrpx_worker.cc index 6b2b658b..a9bf6e65 100644 --- a/src/shrpx_worker.cc +++ b/src/shrpx_worker.cc @@ -24,7 +24,9 @@ */ #include "shrpx_worker.h" +#ifdef HAVE_UNISTD_H #include +#endif // HAVE_UNISTD_H #include diff --git a/src/timegm.h b/src/timegm.h index 529235cf..32a9526d 100644 --- a/src/timegm.h +++ b/src/timegm.h @@ -33,7 +33,9 @@ extern "C" { #endif /* __cplusplus */ +#ifdef HAVE_TIME_H #include +#endif // HAVE_TIME_H #ifndef HAVE_TIMEGM diff --git a/src/util.cc b/src/util.cc index 2926ae9e..20aaca70 100644 --- a/src/util.cc +++ b/src/util.cc @@ -24,15 +24,27 @@ */ #include "util.h" +#ifdef HAVE_TIME_H #include +#endif // HAVE_TIME_H #include +#ifdef HAVE_SYS_SOCKET_H #include +#endif // HAVE_SYS_SOCKET_H +#ifdef HAVE_NETDB_H #include +#endif // HAVE_NETDB_H #include +#ifdef HAVE_FCNTL_H #include +#endif // HAVE_FCNTL_H +#ifdef HAVE_NETINET_IN_H #include +#endif // HAVE_NETINET_IN_H #include +#ifdef HAVE_ARPA_INET_H #include +#endif // HAVE_ARPA_INET_H #include #include diff --git a/src/util.h b/src/util.h index f20624d5..4525df53 100644 --- a/src/util.h +++ b/src/util.h @@ -27,9 +27,13 @@ #include "nghttp2_config.h" +#ifdef HAVE_UNISTD_H #include +#endif // HAVE_UNISTD_H #include +#ifdef HAVE_NETDB_H #include +#endif // HAVE_NETDB_H #include #include diff --git a/src/util_test.h b/src/util_test.h index d8f7dd47..00290b89 100644 --- a/src/util_test.h +++ b/src/util_test.h @@ -25,6 +25,10 @@ #ifndef UTIL_TEST_H #define UTIL_TEST_H +#ifdef HAVE_CONFIG_H +#include +#endif // HAVE_CONFIG_H + namespace shrpx { void test_util_streq(void);