diff --git a/modules/aaa/mod_auth_ldap.c b/modules/aaa/mod_auth_ldap.c index 0beeda8c89..c23cffcd9b 100644 --- a/modules/aaa/mod_auth_ldap.c +++ b/modules/aaa/mod_auth_ldap.c @@ -60,13 +60,14 @@ * Copyright 1999-2001 Dave Carrigan */ -/* for getpid() */ -#include - #include #include #include "ap_config.h" +#if APR_HAVE_UNISTD_H +/* for getpid() */ +#include +#endif #include "httpd.h" #include "http_config.h" #include "http_core.h" diff --git a/modules/ldap/util_ldap.c b/modules/ldap/util_ldap.c index 5f3387a6ba..433ea097e3 100644 --- a/modules/ldap/util_ldap.c +++ b/modules/ldap/util_ldap.c @@ -77,7 +77,9 @@ #include "util_ldap.h" #include "util_ldap_cache.h" +#if APR_HAVE_UNISTD_H #include +#endif module AP_MODULE_DECLARE_DATA ldap_module; diff --git a/modules/ssl/mod_ssl.h b/modules/ssl/mod_ssl.h index c3afa4e349..83b5d42afa 100644 --- a/modules/ssl/mod_ssl.h +++ b/modules/ssl/mod_ssl.h @@ -97,9 +97,6 @@ #include #include #include -#if APR_HAVE_SYS_TIME_H -#include -#endif /* XXX: these better go away */ #include @@ -142,6 +139,16 @@ #include "ssl_util_ssl.h" #include "ssl_util_table.h" +/* The #ifdef macros are only defined AFTER including the above + * therefore we cannot include these system files at the top :-( + */ +#if APR_HAVE_SYS_TIME_H +#include +#endif +#if APR_HAVE_UNISTD_H +#include /* needed for STDIN_FILENO et.al., at least on FreeBSD */ +#endif + /* * Provide reasonable default for some defines */ diff --git a/modules/ssl/ssl_expr_scan.c b/modules/ssl/ssl_expr_scan.c index a2f29924e3..ddfa2fd5a8 100644 --- a/modules/ssl/ssl_expr_scan.c +++ b/modules/ssl/ssl_expr_scan.c @@ -38,7 +38,6 @@ #ifdef __cplusplus #include -#include /* Use prototypes in function declarations. */ #define YY_USE_PROTOS diff --git a/server/mpm/worker/fdqueue.h b/server/mpm/worker/fdqueue.h index a253bbfb28..c59ea254eb 100644 --- a/server/mpm/worker/fdqueue.h +++ b/server/mpm/worker/fdqueue.h @@ -60,7 +60,9 @@ #define FDQUEUE_H #include "httpd.h" #include +#if APR_HAVE_UNISTD_H #include +#endif #include #include #include diff --git a/support/suexec.c b/support/suexec.c index 8550ba9abe..1d77833a89 100644 --- a/support/suexec.c +++ b/support/suexec.c @@ -74,7 +74,9 @@ #include #include #include +#if APR_HAVE_UNISTD_H #include +#endif #include #include