From: Ryan Bloom Date: Mon, 12 Jun 2000 23:03:05 +0000 (+0000) Subject: Protect system header files with the appropriate macros. X-Git-Tag: APACHE_2_0_ALPHA_5~340 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=750d8cc03c5a2a8cc4e36b4d16679ffcb8a04b5f;p=apache Protect system header files with the appropriate macros. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@85558 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/cache/mod_file_cache.c b/modules/cache/mod_file_cache.c index ecb15dbcf3..1f7f4ccba5 100644 --- a/modules/cache/mod_file_cache.c +++ b/modules/cache/mod_file_cache.c @@ -109,11 +109,18 @@ an extra stat() that's a waste. */ +#ifdef HAVE_STDIOP_H #include +#endif +#ifdef HAVE_SYS_TYPES_H #include +#endif +#ifdef HAVE_STRING_H +#include +#endif +/* What are these here for? rbb */ #include #include -#include #define CORE_PRIVATE diff --git a/modules/experimental/mod_charset_lite.c b/modules/experimental/mod_charset_lite.c index 19e25c8c47..282d7814d6 100644 --- a/modules/experimental/mod_charset_lite.c +++ b/modules/experimental/mod_charset_lite.c @@ -66,8 +66,9 @@ * !!!This is an extremely cheap ripoff of mod_charset.c from Russian Apache!!! */ -#include +#ifdef HAVE_STDIO_H #include +#endif #include "httpd.h" #include "http_config.h" diff --git a/modules/filters/mod_include.c b/modules/filters/mod_include.c index f87cb2c7bb..9c571ed9fc 100644 --- a/modules/filters/mod_include.c +++ b/modules/filters/mod_include.c @@ -97,7 +97,9 @@ #include "http_main.h" #include "util_script.h" #include "http_core.h" +#ifdef HAVE_STRING_H #include +#endif #ifdef HAVE_PWD_H #include #endif diff --git a/modules/generators/mod_cgid.c b/modules/generators/mod_cgid.c index 0d8cecfe50..faf6bb7732 100644 --- a/modules/generators/mod_cgid.c +++ b/modules/generators/mod_cgid.c @@ -91,10 +91,11 @@ #include "iol_socket.h" #include "unixd.h" #include -#include /* for sockaddr_un */ +#ifdef HAVE_SYS_SOCKET_H +#include +#endif #include /* for sockaddr_un */ #include -#include module MODULE_VAR_EXPORT cgid_module; diff --git a/modules/http/http_core.c b/modules/http/http_core.c index 56de44efc5..f2f12ceab0 100644 --- a/modules/http/http_core.c +++ b/modules/http/http_core.c @@ -73,7 +73,9 @@ #include "http_connection.h" #include "util_ebcdic.h" #include "mpm.h" +#ifdef HAVE_NETDB_H #include +#endif /* Allow Apache to use ap_mmap */ #ifdef USE_MMAP_FILES diff --git a/modules/http/http_protocol.c b/modules/http/http_protocol.c index ba47c9b6a6..10a788fb70 100644 --- a/modules/http/http_protocol.c +++ b/modules/http/http_protocol.c @@ -77,8 +77,12 @@ #include "util_date.h" /* For parseHTTPdate and BAD_DATE */ #include "util_charset.h" #include "mpm_status.h" +#ifdef HAVE_STDARG_H #include +#endif +#ifdef HAVE_UNISTD_H #include +#endif AP_HOOK_STRUCT( AP_HOOK_LINK(post_read_request) diff --git a/modules/loggers/mod_log_config.c b/modules/loggers/mod_log_config.c index 02c55300ea..2b2409de55 100644 --- a/modules/loggers/mod_log_config.c +++ b/modules/loggers/mod_log_config.c @@ -176,7 +176,9 @@ #include "http_core.h" /* For REMOTE_NAME */ #include "http_log.h" #include "http_protocol.h" +#ifdef HAVE_UNISTD_H #include +#endif #ifdef HAVE_LIMITS_H #include #endif diff --git a/modules/mappers/mod_rewrite.h b/modules/mappers/mod_rewrite.h index f6b66906ca..1c06c46966 100644 --- a/modules/mappers/mod_rewrite.h +++ b/modules/mappers/mod_rewrite.h @@ -94,16 +94,27 @@ /* Include from the underlaying Unix system ... */ +#ifdef HAVE_STRING_H #include +#endif +#ifdef HAVE_STDARG_H #include +#endif +#ifdef HAVE_STDLIB_H #include +#endif +#ifdef HAVE_TIME_H #include -#include -#include +#endif +#ifdef HAVE_CTYPE_H #include +#endif #ifndef NETWARE #include #endif +/* are these needed anymore? rbb */ +#include +#include /* Include from the Apache server ... */ #define CORE_PRIVATE diff --git a/modules/metadata/mod_mime_magic.c b/modules/metadata/mod_mime_magic.c index 892b226b4c..9a18dfa1fd 100644 --- a/modules/metadata/mod_mime_magic.c +++ b/modules/metadata/mod_mime_magic.c @@ -132,8 +132,12 @@ #include "http_log.h" #include "http_protocol.h" #include "util_script.h" +#ifdef HAVE_SYS_STAT_H #include +#endif +#ifdef HAVE_UNISTD_H #include +#endif #ifdef HAVE_UTIME_H #include #endif diff --git a/modules/metadata/mod_unique_id.c b/modules/metadata/mod_unique_id.c index bce1c56472..48b9dbbf53 100644 --- a/modules/metadata/mod_unique_id.c +++ b/modules/metadata/mod_unique_id.c @@ -68,10 +68,18 @@ #include "http_log.h" #include "http_protocol.h" /* for ap_hook_post_read_request */ +#ifdef HAVE_NETDB_H #include +#endif +#ifdef HAVE_UNISTD_H #include +#endif +#ifdef HAVE_NETINET_IN_H #include +#endif +#ifdef HAVE_ARPA_INET_H #include +#endif typedef struct { unsigned int stamp; diff --git a/os/unix/os-inline.c b/os/unix/os-inline.c index f634e5427d..4f93733175 100644 --- a/os/unix/os-inline.c +++ b/os/unix/os-inline.c @@ -74,7 +74,9 @@ * INLINE will _not_ be set so we can use this to test if we are * compiling this source file. */ +#ifdef HAVE_UNISTD_H #include +#endif #ifndef INLINE #define INLINE diff --git a/os/unix/unixd.c b/os/unix/unixd.c index 675786249c..a66793c8ff 100644 --- a/os/unix/unixd.c +++ b/os/unix/unixd.c @@ -62,11 +62,18 @@ #include "http_main.h" #include "http_log.h" #include "unixd.h" +#ifdef HAVE_PWD_H #include +#endif +#ifdef HAVE_SYS_RESOURCE_H #include -#include +#endif +#ifdef HAVE_UNISTD_H #include +#endif +#ifdef HAVE_GRP_H #include +#endif unixd_config_rec unixd_config; diff --git a/os/unix/unixd.h b/os/unix/unixd.h index f97020d6e3..df5659c734 100644 --- a/os/unix/unixd.h +++ b/os/unix/unixd.h @@ -60,7 +60,9 @@ #define UNIXD_H #include "httpd.h" +#ifdef HAVE_SYS_RESOURCE_H #include +#endif /* common stuff that unix MPMs will want */ diff --git a/server/connection.c b/server/connection.c index 7c9e0e646a..984c18b60a 100644 --- a/server/connection.c +++ b/server/connection.c @@ -67,8 +67,12 @@ #include "http_config.h" #include "http_vhost.h" +#ifdef HAVE_NETINET_IN_H #include +#endif +#ifdef HAVE_ARPA_INET_H #include +#endif AP_HOOK_STRUCT( AP_HOOK_LINK(pre_connection) diff --git a/server/listen.c b/server/listen.c index 901926a918..802c423137 100644 --- a/server/listen.c +++ b/server/listen.c @@ -64,7 +64,9 @@ #include "http_config.h" #include "ap_listen.h" #include "http_log.h" +#ifdef HAVE_STRING_H #include +#endif ap_listen_rec *ap_listeners; static ap_listen_rec *old_listeners; diff --git a/server/log.c b/server/log.c index ad261a5ef0..53a97cbe9f 100644 --- a/server/log.c +++ b/server/log.c @@ -75,7 +75,9 @@ #include "http_log.h" #include "http_main.h" +#ifdef HAVE_STDARG_H #include +#endif typedef struct { char *t_name; diff --git a/server/mpm/dexter/dexter.c b/server/mpm/dexter/dexter.c index 29a8a0875f..54f5a93ffa 100644 --- a/server/mpm/dexter/dexter.c +++ b/server/mpm/dexter/dexter.c @@ -76,9 +76,13 @@ #include "mpm.h" #include "scoreboard.h" +#ifdef HAVE_UNISTD_H #include +#endif #include +#ifdef HAVE_SYS_SOCKET_H #include +#endif #ifdef HAVE_NETINET_TCP_H #include #endif diff --git a/server/mpm/dexter/scoreboard.c b/server/mpm/dexter/scoreboard.c index 5e025fe32f..99f53eb5dc 100644 --- a/server/mpm/dexter/scoreboard.c +++ b/server/mpm/dexter/scoreboard.c @@ -67,7 +67,9 @@ #include "mpm_status.h" #include "scoreboard.h" #include "mpm.h" /* for ap_max_daemons_limit */ +#ifdef HAVE_SYS_TYPES_H #include +#endif static scoreboard *ap_scoreboard_image = NULL; API_VAR_EXPORT char *ap_scoreboard_fname; diff --git a/server/mpm/mpmt_pthread/mpmt_pthread.c b/server/mpm/mpmt_pthread/mpmt_pthread.c index a23df678e8..e289aa50ef 100644 --- a/server/mpm/mpmt_pthread/mpmt_pthread.c +++ b/server/mpm/mpmt_pthread/mpmt_pthread.c @@ -78,8 +78,12 @@ #ifdef HAVE_NETINET_TCP_H #include #endif -#include +#ifdef HAVE_SYS_SOCKET_H +#include +#endif +#ifdef HAVE_SYS_WAIT_H #include +#endif #include #include diff --git a/server/mpm/mpmt_pthread/scoreboard.c b/server/mpm/mpmt_pthread/scoreboard.c index 32aea8859d..4fe6b5a7ce 100644 --- a/server/mpm/mpmt_pthread/scoreboard.c +++ b/server/mpm/mpmt_pthread/scoreboard.c @@ -68,7 +68,9 @@ #include "mpm_status.h" #include "mpm.h" #include "scoreboard.h" +#ifdef HAVE_SYS_TYPES_H #include +#endif scoreboard *ap_scoreboard_image = NULL; new_scoreboard *ap_new_scoreboard_image = NULL; diff --git a/server/mpm/prefork/prefork.c b/server/mpm/prefork/prefork.c index d1aeaefde2..d04eacdee2 100644 --- a/server/mpm/prefork/prefork.c +++ b/server/mpm/prefork/prefork.c @@ -105,12 +105,18 @@ #include "iol_socket.h" #include "ap_listen.h" #include "ap_mmn.h" -#include +#ifdef HAVE_SYS_TYPES_H #include +#endif +#ifdef HAVE_SYS_WAIT_H #include +#endif +#ifdef HAVE_SYS_SOCKET_H #include +#endif +#ifdef HAVE_UNISTD_H #include - +#endif #ifdef HAVE_NETINET_TCP_H #include /* for TCP_NODELAY */ #endif @@ -119,6 +125,7 @@ #include /* for IRIX, FD_SET calls bzero() */ #endif #include +#include /* config globals */ diff --git a/server/rfc1413.c b/server/rfc1413.c index 4dc3bec5fb..e28cb9ea06 100644 --- a/server/rfc1413.c +++ b/server/rfc1413.c @@ -86,7 +86,9 @@ #include "http_main.h" /* set_callback_and_alarm */ #include "util_ebcdic.h" #include "apr_network_io.h" +#ifdef HAVE_STRING_H #include +#endif /* Local stuff. */ /* Semi-well-known port */ diff --git a/server/util.c b/server/util.c index 57cd73fb25..75a1495452 100644 --- a/server/util.c +++ b/server/util.c @@ -80,11 +80,21 @@ #include "http_config.h" #include "util_ebcdic.h" +#ifdef HAVE_STDIO_H #include +#endif +#ifdef HAVE_UNISTD_H #include +#endif +#ifdef HAVE_NETINET_IN_H #include +#endif +#ifdef HAVE_NETDB_H #include +#endif +#ifdef HAVE_ARPA_INET_H #include +#endif #ifdef HAVE_PWD_H #include #endif @@ -92,7 +102,6 @@ #include #endif - /* A bunch of functions in util.c scan strings looking for certain characters. * To make that more efficient we encode a lookup table. The test_char_table * is generated automatically by gen_test_char.c. diff --git a/server/util_date.c b/server/util_date.c index 8373cd63a1..52f3361638 100644 --- a/server/util_date.c +++ b/server/util_date.c @@ -71,8 +71,12 @@ #include "ap_config.h" #include "util_date.h" +#ifdef HAVE_CTYPE_H #include +#endif +#ifdef HAVE_STRING_H #include +#endif /* * Compare a string to a mask diff --git a/server/util_script.c b/server/util_script.c index cea70954f9..ea131cef0d 100644 --- a/server/util_script.c +++ b/server/util_script.c @@ -68,8 +68,12 @@ #include "util_script.h" #include "util_date.h" /* For parseHTTPdate() */ #include "util_ebcdic.h" +#ifdef HAVE_STDLIB_H #include +#endif +#ifdef HAVE_STRING_H #include +#endif #ifdef OS2 #define INCL_DOS diff --git a/server/util_uri.c b/server/util_uri.c index 79630e385f..9f9ee6ebc3 100644 --- a/server/util_uri.c +++ b/server/util_uri.c @@ -65,8 +65,12 @@ #include "httpd.h" #include "http_log.h" #include "util_uri.h" +#ifdef HAVE_STRING_H #include +#endif +#ifdef HAVE_NETDB_H #include +#endif /* Some WWW schemes and their default ports; this is basically /etc/services */ /* This will become global when the protocol abstraction comes */ diff --git a/server/vhost.c b/server/vhost.c index 291a5b762c..d8a5091bd9 100644 --- a/server/vhost.c +++ b/server/vhost.c @@ -70,9 +70,15 @@ #include "http_protocol.h" #include "http_core.h" +#ifdef HAVE_ARPA_INET_H #include +#endif +#ifdef HAVE_NETINET_IN_H #include +#endif +#ifdef HAVE_NETDB_H #include +#endif /* * After all the definitions there's an explanation of how it's all put diff --git a/support/ab.c b/support/ab.c index 9c8c484bf8..f28b237a0a 100644 --- a/support/ab.c +++ b/support/ab.c @@ -121,10 +121,18 @@ #ifdef NOT_ASCII #include "apr_xlate.h" #endif +#ifdef HAVE_STRING_H #include +#endif +#ifdef HAVE_STDIO_H #include +#endif +#ifdef HAVE_STDLIB_H #include +#endif +#ifdef HAVE_CTYPE_H #include +#endif /* ------------------- DEFINITIONS -------------------------- */ @@ -840,14 +848,14 @@ static void test(void) static void copyright(void) { if (!use_html) { - printf("This is ApacheBench, Version %s\n", AB_VERSION " <$Revision: 1.17 $> apache-2.0"); + printf("This is ApacheBench, Version %s\n", AB_VERSION " <$Revision: 1.18 $> apache-2.0"); printf("Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/\n"); printf("Copyright (c) 1998-2000 The Apache Software Foundation, http://www.apache.org/\n"); printf("\n"); } else { printf("

\n"); - printf(" This is ApacheBench, Version %s <%s> apache-2.0
\n", AB_VERSION, "$Revision: 1.17 $"); + printf(" This is ApacheBench, Version %s <%s> apache-2.0
\n", AB_VERSION, "$Revision: 1.18 $"); printf(" Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
\n"); printf(" Copyright (c) 1998-2000 The Apache Software Foundation, http://www.apache.org/
\n"); printf("

\n

\n"); diff --git a/support/logresolve.c b/support/logresolve.c index 78aa64a8ee..bce7bedd22 100644 --- a/support/logresolve.c +++ b/support/logresolve.c @@ -40,9 +40,13 @@ */ #include "ap_config.h" -#include #include +#ifdef HAVE_CTYPE_H +#include +#endif +#ifdef HAVE_NETDB_H #include +#endif #if !defined(MPE) && !defined(BEOS) && !defined(WIN32) #include diff --git a/support/rotatelogs.c b/support/rotatelogs.c index 6d1b9267e2..5f1040e198 100644 --- a/support/rotatelogs.c +++ b/support/rotatelogs.c @@ -62,12 +62,14 @@ #include "ap_config.h" +#include +#ifdef HAVE_UNISTD_H +#include +#endif +#include #include #include #include -#include -#include -#include #define BUFSIZE 65536