1
0
mirror of https://github.com/apache/httpd.git synced 2025-09-01 02:02:06 +03:00

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
This commit is contained in:
Ryan Bloom
2000-06-12 23:03:05 +00:00
parent 47df25ba18
commit 750d8cc03c
30 changed files with 140 additions and 17 deletions

View File

@@ -109,11 +109,18 @@
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

View 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"

View 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

View File

@@ -91,10 +91,11 @@
#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;

View 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

View File

@@ -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 <stdarg.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
AP_HOOK_STRUCT(
AP_HOOK_LINK(post_read_request)

View File

@@ -176,7 +176,9 @@
#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

View File

@@ -94,16 +94,27 @@
/* 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

View File

@@ -132,8 +132,12 @@
#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

View File

@@ -68,10 +68,18 @@
#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;

View 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

View File

@@ -62,11 +62,18 @@
#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;

View 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 */

View File

@@ -67,8 +67,12 @@
#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)

View 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;

View 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;

View File

@@ -76,9 +76,13 @@
#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

View 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;

View File

@@ -78,8 +78,12 @@
#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>

View 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;

View File

@@ -105,12 +105,18 @@
#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
@@ -119,6 +125,7 @@
#include <bstring.h> /* for IRIX, FD_SET calls bzero() */
#endif
#include <signal.h>
#include <sys/times.h>
/* config globals */

View 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 */

View File

@@ -80,11 +80,21 @@
#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
@@ -92,7 +102,6 @@
#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.

View File

@@ -71,8 +71,12 @@
#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

View File

@@ -68,8 +68,12 @@
#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

View File

@@ -65,8 +65,12 @@
#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 */

View File

@@ -70,9 +70,15 @@
#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

View File

@@ -121,10 +121,18 @@
#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");

View File

@@ -40,9 +40,13 @@
*/
#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>

View File

@@ -62,12 +62,14 @@
#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