]> granicus.if.org Git - apache/commitdiff
Protect system header files with the appropriate macros.
authorRyan Bloom <rbb@apache.org>
Mon, 12 Jun 2000 23:03:05 +0000 (23:03 +0000)
committerRyan Bloom <rbb@apache.org>
Mon, 12 Jun 2000 23:03:05 +0000 (23:03 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@85558 13f79535-47bb-0310-9956-ffa450edef68

30 files changed:
modules/cache/mod_file_cache.c
modules/experimental/mod_charset_lite.c
modules/filters/mod_include.c
modules/generators/mod_cgid.c
modules/http/http_core.c
modules/http/http_protocol.c
modules/loggers/mod_log_config.c
modules/mappers/mod_rewrite.h
modules/metadata/mod_mime_magic.c
modules/metadata/mod_unique_id.c
os/unix/os-inline.c
os/unix/unixd.c
os/unix/unixd.h
server/connection.c
server/listen.c
server/log.c
server/mpm/dexter/dexter.c
server/mpm/dexter/scoreboard.c
server/mpm/mpmt_pthread/mpmt_pthread.c
server/mpm/mpmt_pthread/scoreboard.c
server/mpm/prefork/prefork.c
server/rfc1413.c
server/util.c
server/util_date.c
server/util_script.c
server/util_uri.c
server/vhost.c
support/ab.c
support/logresolve.c
support/rotatelogs.c

index ecb15dbcf3116fdf75126578d08b5eb07d5d177e..1f7f4ccba5407ae703f3bae90c4b871051914eb1 100644 (file)
     an extra stat() that's a waste.
 */
 
+#ifdef HAVE_STDIOP_H
 #include <stdio.h>
+#endif
+#ifdef HAVE_SYS_TYPES_H
 #include <sys/types.h>
+#endif
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+/* What are these here for? rbb */
 #include <fcntl.h>
 #include <errno.h>
-#include <string.h>
 
 #define CORE_PRIVATE
 
index 19e25c8c47f5a5a9d00f4fe7ebc41d1e5a3cd772..282d7814d627bf29b1dff2f8176d72b973fb66a0 100644 (file)
@@ -66,8 +66,9 @@
  * !!!This is an extremely cheap ripoff of mod_charset.c from Russian Apache!!!
  */
 
-#include <errno.h>
+#ifdef HAVE_STDIO_H
 #include <stdio.h>
+#endif
 
 #include "httpd.h"
 #include "http_config.h"
index f87cb2c7bb195fbe9a3ebefcbc921884018af9ed..9c571ed9fcc73063ac3a314abd12884ec12e8ef7 100644 (file)
@@ -97,7 +97,9 @@
 #include "http_main.h"
 #include "util_script.h"
 #include "http_core.h"
+#ifdef HAVE_STRING_H
 #include <string.h>
+#endif
 #ifdef HAVE_PWD_H
 #include <pwd.h>
 #endif
index 0d8cecfe50435cb89b9b577f1dab9a09da4f559f..faf6bb7732617a21a177e6894248f95d17634e84 100644 (file)
 #include "iol_socket.h"
 #include "unixd.h"
 #include <sys/stat.h>
-#include <sys/socket.h> /* for sockaddr_un */
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
 #include <sys/un.h> /* for sockaddr_un */
 #include <sys/types.h>
-#include <sys/stat.h>
 
 module MODULE_VAR_EXPORT cgid_module; 
 
index 56de44efc5565ba9e0719bf3cea77127a188c3b2..f2f12ceab0eac853a54b330d6d198f4f0caf2793 100644 (file)
@@ -73,7 +73,9 @@
 #include "http_connection.h"
 #include "util_ebcdic.h"
 #include "mpm.h"
+#ifdef HAVE_NETDB_H
 #include <netdb.h>
+#endif
 
 /* Allow Apache to use ap_mmap */
 #ifdef USE_MMAP_FILES
index ba47c9b6a657231c536e0261cad0b71046c3c4b7..10a788fb7066154d4fd81b044caf47a15a347c64 100644 (file)
 #include "util_date.h"          /* For parseHTTPdate and BAD_DATE */
 #include "util_charset.h"
 #include "mpm_status.h"
+#ifdef HAVE_STDARG_H
 #include <stdarg.h>
+#endif
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
+#endif
 
 AP_HOOK_STRUCT(
            AP_HOOK_LINK(post_read_request)
index 02c55300eaa01eac2b775e2a6c65a6cbebef0965..2b2409de55661d49f17c687ea8e49d83018b7041 100644 (file)
 #include "http_core.h"          /* For REMOTE_NAME */
 #include "http_log.h"
 #include "http_protocol.h"
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
+#endif
 #ifdef HAVE_LIMITS_H
 #include <limits.h>
 #endif
index f6b66906ca9c51086bd34c53aa20a3db73003b0e..1c06c469662a8ee52c9b576b4c275530634aaa52 100644 (file)
 
 
     /* Include from the underlaying Unix system ... */
+#ifdef HAVE_STRING_H
 #include <string.h>
+#endif
+#ifdef HAVE_STDARG_H
 #include <stdarg.h>
+#endif
+#ifdef HAVE_STDLIB_H
 #include <stdlib.h>
+#endif
+#ifdef HAVE_TIME_H
 #include <time.h>
-#include <signal.h>
-#include <errno.h>
+#endif
+#ifdef HAVE_CTYPE_H
 #include <ctype.h>
+#endif
 #ifndef NETWARE
 #include <sys/types.h>
 #endif
+/* are these needed anymore?  rbb */
+#include <signal.h>
+#include <errno.h>
 
     /* Include from the Apache server ... */
 #define CORE_PRIVATE
index 892b226b4c5438f009f2a6b69a6ffa11eb176eb0..9a18dfa1fdd5237f1fe9c88e2c3d6134005a307b 100644 (file)
 #include "http_log.h"
 #include "http_protocol.h"
 #include "util_script.h"
+#ifdef HAVE_SYS_STAT_H
 #include <sys/stat.h>
+#endif
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
+#endif
 #ifdef HAVE_UTIME_H
 #include <utime.h>
 #endif
index bce1c56472706a23167be1810e0cc0bd885dd6b1..48b9dbbf533f0e6e7f4b8b1e095840caeb488628 100644 (file)
 #include "http_log.h"
 #include "http_protocol.h"  /* for ap_hook_post_read_request */
 
+#ifdef HAVE_NETDB_H
 #include <netdb.h>
+#endif
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
+#endif
+#ifdef HAVE_NETINET_IN_H
 #include <netinet/in.h>
+#endif
+#ifdef HAVE_ARPA_INET_H
 #include <arpa/inet.h>
+#endif
 
 typedef struct {
     unsigned int stamp;
index f634e5427d6410afa25b59ecdea94955787c0a5e..4f93733175aa8b4bed0411f5e7608682cc13a77a 100644 (file)
@@ -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 <unistd.h>
+#endif
 
 #ifndef INLINE
 #define INLINE
index 675786249c343f49c4be52dba0e48108b71af307..a66793c8ff8a73a3eef37c76b9bbb5c1b20f2efa 100644 (file)
 #include "http_main.h"
 #include "http_log.h"
 #include "unixd.h"
+#ifdef HAVE_PWD_H
 #include <pwd.h>
+#endif
+#ifdef HAVE_SYS_RESOURCE_H
 #include <sys/resource.h>
-#include <sys/resource.h>
+#endif
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
+#endif
+#ifdef HAVE_GRP_H
 #include <grp.h>
+#endif
 
 unixd_config_rec unixd_config;
 
index f97020d6e30091a9714e8c48e71928156ed95305..df5659c734981d018e6f54d5e86e5832cdef63cc 100644 (file)
@@ -60,7 +60,9 @@
 #define UNIXD_H
 
 #include "httpd.h"
+#ifdef HAVE_SYS_RESOURCE_H
 #include <sys/resource.h>
+#endif
 
 /* common stuff that unix MPMs will want */
 
index 7c9e0e646a6feec66e8beba3109d9b42048ca71f..984c18b60a0e02ad19de4a1f5299b5625eae964a 100644 (file)
 #include "http_config.h"
 #include "http_vhost.h"
 
+#ifdef HAVE_NETINET_IN_H
 #include <netinet/in.h>
+#endif
+#ifdef HAVE_ARPA_INET_H
 #include <arpa/inet.h>
+#endif
 
 AP_HOOK_STRUCT(
            AP_HOOK_LINK(pre_connection)
index 901926a9185251b600d405e4ff77801c4e2d9ba4..802c4231379f52f99ab9c2c0cf510b45333368a0 100644 (file)
@@ -64,7 +64,9 @@
 #include "http_config.h"
 #include "ap_listen.h"
 #include "http_log.h"
+#ifdef HAVE_STRING_H
 #include <string.h>
+#endif
 
 ap_listen_rec *ap_listeners;
 static ap_listen_rec *old_listeners;
index ad261a5ef0a83a4db386a7c07f5d585aa3edb21d..53a97cbe9fe9a8a747b5ce5d89b0e0dd53be939c 100644 (file)
@@ -75,7 +75,9 @@
 #include "http_log.h"
 #include "http_main.h"
 
+#ifdef HAVE_STDARG_H
 #include <stdarg.h>
+#endif
 
 typedef struct {
        char    *t_name;
index 29a8a0875f0fa5bd6ebb0c0ee84cd357deeab20f..54f5a93ffac5b1535c9eb58b001125bf4a059b1e 100644 (file)
 #include "mpm.h"
 #include "scoreboard.h"
 
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
+#endif
 #include <poll.h>
+#ifdef HAVE_SYS_SOCKET_H
 #include <sys/socket.h>
+#endif
 #ifdef HAVE_NETINET_TCP_H
 #include <netinet/tcp.h>
 #endif
index 5e025fe32fa006b14015487b267f50cd5ed7ca56..99f53eb5dc517f85895c83dd5e7f6916a9be62d8 100644 (file)
@@ -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 <sys/types.h>
+#endif
 
 static scoreboard *ap_scoreboard_image = NULL;
 API_VAR_EXPORT char *ap_scoreboard_fname;
index a23df678e8248a626b71dcd823e2f7f720abfd4d..e289aa50ef1397d3f9666564087961f8c166a51c 100644 (file)
 #ifdef HAVE_NETINET_TCP_H
 #include <netinet/tcp.h>
 #endif
-#include <sys/socket.h> 
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_SYS_WAIT_H
 #include <sys/wait.h> 
+#endif
 #include <pthread.h>
 #include <signal.h>
 
index 32aea8859de4aeea1503a88e8271c9c447989da7..4fe6b5a7ce50201f74d3deecf91b24449db01f10 100644 (file)
@@ -68,7 +68,9 @@
 #include "mpm_status.h"
 #include "mpm.h"
 #include "scoreboard.h"
+#ifdef HAVE_SYS_TYPES_H
 #include <sys/types.h>
+#endif
 
 scoreboard *ap_scoreboard_image = NULL;
 new_scoreboard *ap_new_scoreboard_image = NULL;
index d1aeaefde27e7fc4083f496346e0ee7aa68fbfe9..d04eacdee2f324b83700a33b423176eed4ddd0fb 100644 (file)
 #include "iol_socket.h"
 #include "ap_listen.h"
 #include "ap_mmn.h"
-#include <sys/times.h>
+#ifdef HAVE_SYS_TYPES_H
 #include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_WAIT_H
 #include <sys/wait.h>
+#endif
+#ifdef HAVE_SYS_SOCKET_H
 #include <sys/socket.h>
+#endif
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
-
+#endif
 #ifdef HAVE_NETINET_TCP_H
 #include <netinet/tcp.h>       /* for TCP_NODELAY */
 #endif
 #include <bstring.h>           /* for IRIX, FD_SET calls bzero() */
 #endif
 #include <signal.h>
+#include <sys/times.h>
 
 /* config globals */
 
index 4dc3bec5fb3f815156b0a1951e73f9f6eda89185..e28cb9ea067e331c762c7266cffb779e0735a6d7 100644 (file)
@@ -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 <string.h>
+#endif
 
 /* Local stuff. */
 /* Semi-well-known port */
index 57cd73fb25b8fcf98ab8f2147418bead7008aba4..75a149545250715e327395c691d271a0254f65b8 100644 (file)
 #include "http_config.h"
 #include "util_ebcdic.h"
 
+#ifdef HAVE_STDIO_H
 #include <stdio.h>
+#endif
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
+#endif
+#ifdef HAVE_NETINET_IN_H
 #include <netinet/in.h>
+#endif
+#ifdef HAVE_NETDB_H
 #include <netdb.h>
+#endif
+#ifdef HAVE_ARPA_INET_H
 #include <arpa/inet.h>
+#endif
 #ifdef HAVE_PWD_H
 #include <pwd.h>
 #endif
 #include <grp.h>
 #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.
index 8373cd63a1ff299bdf495378b36130de2262a1a0..52f33616389a2ee31b2590538e296c50bc34af4b 100644 (file)
 
 #include "ap_config.h"
 #include "util_date.h"
+#ifdef HAVE_CTYPE_H
 #include <ctype.h>
+#endif
+#ifdef HAVE_STRING_H
 #include <string.h>
+#endif
 
 /*
  * Compare a string to a mask
index cea70954f9dcca46fcc5522893e256c9192fa578..ea131cef0d2aecece485fa358fffa574f845068c 100644 (file)
 #include "util_script.h"
 #include "util_date.h"         /* For parseHTTPdate() */
 #include "util_ebcdic.h"
+#ifdef HAVE_STDLIB_H
 #include <stdlib.h>
+#endif
+#ifdef HAVE_STRING_H
 #include <string.h>
+#endif
 
 #ifdef OS2
 #define INCL_DOS
index 79630e385f40a4e92ddd97d395049c054d7a0480..9f9ee6ebc317850c8c64ea01cb4d3310f59cf814 100644 (file)
 #include "httpd.h"
 #include "http_log.h"
 #include "util_uri.h"
+#ifdef HAVE_STRING_H
 #include <string.h>
+#endif
+#ifdef HAVE_NETDB_H
 #include <netdb.h>
+#endif
 
 /* Some WWW schemes and their default ports; this is basically /etc/services */
 /* This will become global when the protocol abstraction comes */
index 291a5b762c0dff7a4e6d9cf697c727dc6555f065..d8a5091bd9e9f481b7593de6902a73f71d60c317 100644 (file)
 #include "http_protocol.h"
 #include "http_core.h"
 
+#ifdef HAVE_ARPA_INET_H
 #include <arpa/inet.h>
+#endif
+#ifdef HAVE_NETINET_IN_H
 #include <netinet/in.h>
+#endif
+#ifdef HAVE_NETDB_H
 #include <netdb.h>
+#endif
 
 /*
  * After all the definitions there's an explanation of how it's all put
index 9c8c484bf8832adeeea4234272d045bac3fc2c8c..f28b237a0ab94fe4c6b6f99f288894e86a8189a7 100644 (file)
 #ifdef NOT_ASCII
 #include "apr_xlate.h"
 #endif
+#ifdef HAVE_STRING_H
 #include <string.h>
+#endif
+#ifdef HAVE_STDIO_H
 #include <stdio.h>
+#endif
+#ifdef HAVE_STDLIB_H
 #include <stdlib.h>
+#endif
+#ifdef HAVE_CTYPE_H
 #include <ctype.h>
+#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("<p>\n");
-        printf(" This is ApacheBench, Version %s <i>&lt;%s&gt;</i> apache-2.0<br>\n", AB_VERSION, "$Revision: 1.17 $");
+        printf(" This is ApacheBench, Version %s <i>&lt;%s&gt;</i> apache-2.0<br>\n", AB_VERSION, "$Revision: 1.18 $");
         printf(" Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/<br>\n");
         printf(" Copyright (c) 1998-2000 The Apache Software Foundation, http://www.apache.org/<br>\n");
         printf("</p>\n<p>\n");
index 78aa64a8ee6cb4ac3d55d14e36b95b4f48816c48..bce7bedd22dfda013f7c40fc4c5e552749322bec 100644 (file)
  */
 
 #include "ap_config.h"
-#include <ctype.h>
 #include <stdio.h>
+#ifdef HAVE_CTYPE_H
+#include <ctype.h>
+#endif
+#ifdef HAVE_NETDB_H
 #include <netdb.h>
+#endif
 
 #if !defined(MPE) && !defined(BEOS) && !defined(WIN32)
 #include <arpa/inet.h>
index 6d1b9267e26e203cd4fe5c9c27570b5bd55c5faa..5f1040e1989ac6436eb091e9f8567d20b2319662 100644 (file)
 
 
 #include "ap_config.h"
+#include <stdio.h>
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#include <stdlib.h>
 #include <time.h>
 #include <errno.h>
 #include <fcntl.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
 
 #define BUFSIZE                65536