diff options
134 files changed, 248 insertions, 67 deletions
@@ -41,6 +41,7 @@ NEWS * [autobuild] use AC_CANONICAL_HOST instead of AC_CANONICAL_TARGET (fixes #1866) * [core] fix request_start in keep-alive requests to mark time when received first byte (fixes #2412) * [core] truncate pidfile on exit (fixes #2695) + * consistent inclusion of config.h at top of files (fixes #2073) - 1.4.39 - 2016-01-02 * [core] fix memset_s call (fixes #2698) diff --git a/src/array.c b/src/array.c index 05b03702..189d54e3 100644 --- a/src/array.c +++ b/src/array.c @@ -1,3 +1,5 @@ +#include "first.h" + #include "array.h" #include "buffer.h" diff --git a/src/array.h b/src/array.h index 964f2316..f6b3d0b1 100644 --- a/src/array.h +++ b/src/array.h @@ -1,9 +1,6 @@ #ifndef ARRAY_H #define ARRAY_H - -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif +#include "first.h" #ifdef HAVE_PCRE_H # include <pcre.h> @@ -1,9 +1,7 @@ #ifndef _BASE_H_ #define _BASE_H_ +#include "first.h" -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif #include "settings.h" #include <sys/types.h> diff --git a/src/base64.c b/src/base64.c index 79045e0b..25739bff 100644 --- a/src/base64.c +++ b/src/base64.c @@ -1,3 +1,5 @@ +#include "first.h" + #include "base64.h" /* reverse mapping: diff --git a/src/base64.h b/src/base64.h index b720372a..615f32f2 100644 --- a/src/base64.h +++ b/src/base64.h @@ -1,5 +1,6 @@ #ifndef _BASE64_H_ #define _BASE64_H_ +#include "first.h" #include "buffer.h" diff --git a/src/buffer.c b/src/buffer.c index 9b8088ee..64946562 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -1,3 +1,5 @@ +#include "first.h" + #include "buffer.h" #include <stdlib.h> diff --git a/src/buffer.h b/src/buffer.h index 996db996..ebdbf2f7 100644 --- a/src/buffer.h +++ b/src/buffer.h @@ -1,9 +1,6 @@ #ifndef _BUFFER_H_ #define _BUFFER_H_ - -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif +#include "first.h" #include "settings.h" diff --git a/src/chunk.c b/src/chunk.c index fd4b295f..d4cebafe 100644 --- a/src/chunk.c +++ b/src/chunk.c @@ -1,3 +1,5 @@ +#include "first.h" + /** * the network chunk-API * diff --git a/src/chunk.h b/src/chunk.h index cf313aad..d64345a9 100644 --- a/src/chunk.h +++ b/src/chunk.h @@ -1,5 +1,6 @@ #ifndef _CHUNK_H_ #define _CHUNK_H_ +#include "first.h" #include "buffer.h" #include "array.h" diff --git a/src/configfile-glue.c b/src/configfile-glue.c index e49aaee9..ed4e1854 100644 --- a/src/configfile-glue.c +++ b/src/configfile-glue.c @@ -1,3 +1,5 @@ +#include "first.h" + #include "base.h" #include "buffer.h" #include "array.h" diff --git a/src/configfile.c b/src/configfile.c index b81e988d..d8ffafb9 100644 --- a/src/configfile.c +++ b/src/configfile.c @@ -1,3 +1,5 @@ +#include "first.h" + #include "server.h" #include "log.h" #include "stream.h" diff --git a/src/configfile.h b/src/configfile.h index c6113142..6c8d6b24 100644 --- a/src/configfile.h +++ b/src/configfile.h @@ -1,5 +1,6 @@ #ifndef _CONFIG_PARSER_H_ #define _CONFIG_PARSER_H_ +#include "first.h" #include "array.h" #include "buffer.h" diff --git a/src/configparser.y b/src/configparser.y index 8606bc71..b5da5a9d 100644 --- a/src/configparser.y +++ b/src/configparser.y @@ -3,6 +3,7 @@ %name configparser %include { +#include "first.h" #include "configfile.h" #include "buffer.h" #include "array.h" diff --git a/src/connections-glue.c b/src/connections-glue.c index 5ef7a1e0..0263183c 100644 --- a/src/connections-glue.c +++ b/src/connections-glue.c @@ -1,3 +1,5 @@ +#include "first.h" + #include "base.h" #include "connections.h" diff --git a/src/connections.c b/src/connections.c index 3e70e0d7..f33fcd69 100644 --- a/src/connections.c +++ b/src/connections.c @@ -1,3 +1,5 @@ +#include "first.h" + #include "buffer.h" #include "server.h" #include "log.h" diff --git a/src/connections.h b/src/connections.h index 1fcfc365..f58346d7 100644 --- a/src/connections.h +++ b/src/connections.h @@ -1,5 +1,6 @@ #ifndef _CONNECTIONS_H_ #define _CONNECTIONS_H_ +#include "first.h" #include "server.h" #include "fdevent.h" diff --git a/src/crc32.c b/src/crc32.c index b19bec59..e22f1795 100644 --- a/src/crc32.c +++ b/src/crc32.c @@ -1,3 +1,5 @@ +#include "first.h" + #include "crc32.h" #define CRC32C(c,d) (c=(c>>8)^crc_c[(c^(d))&0xFF]) diff --git a/src/crc32.h b/src/crc32.h index 10e0e901..d38f4c27 100644 --- a/src/crc32.h +++ b/src/crc32.h @@ -1,9 +1,6 @@ #ifndef __crc32cr_table_h__ #define __crc32cr_table_h__ - -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif +#include "first.h" #include <sys/types.h> diff --git a/src/data_array.c b/src/data_array.c index 53249903..b375276f 100644 --- a/src/data_array.c +++ b/src/data_array.c @@ -1,3 +1,5 @@ +#include "first.h" + #include "array.h" #include <string.h> diff --git a/src/data_config.c b/src/data_config.c index fa666d60..d8aafcef 100644 --- a/src/data_config.c +++ b/src/data_config.c @@ -1,3 +1,5 @@ +#include "first.h" + #include "array.h" #include <string.h> diff --git a/src/data_count.c b/src/data_count.c index 9d6e399b..476eb0bb 100644 --- a/src/data_count.c +++ b/src/data_count.c @@ -1,3 +1,5 @@ +#include "first.h" + #include "array.h" #include <string.h> diff --git a/src/data_fastcgi.c b/src/data_fastcgi.c index 16bedb42..a0e4a4b2 100644 --- a/src/data_fastcgi.c +++ b/src/data_fastcgi.c @@ -1,3 +1,5 @@ +#include "first.h" + #include "array.h" #include "fastcgi.h" diff --git a/src/data_integer.c b/src/data_integer.c index 4fb4d24e..429cc30b 100644 --- a/src/data_integer.c +++ b/src/data_integer.c @@ -1,3 +1,5 @@ +#include "first.h" + #include "array.h" #include <stdio.h> diff --git a/src/data_string.c b/src/data_string.c index 0aebdc1b..c1573a96 100644 --- a/src/data_string.c +++ b/src/data_string.c @@ -1,3 +1,5 @@ +#include "first.h" + #include "array.h" #include <string.h> @@ -1,3 +1,5 @@ +#include "first.h" + #include "buffer.h" #include "etag.h" @@ -1,5 +1,6 @@ #ifndef ETAG_H #define ETAG_H +#include "first.h" #include "buffer.h" diff --git a/src/fdevent.c b/src/fdevent.c index 46bd7551..e9038abc 100644 --- a/src/fdevent.c +++ b/src/fdevent.c @@ -1,3 +1,5 @@ +#include "first.h" + #include "base.h" #include "log.h" diff --git a/src/fdevent.h b/src/fdevent.h index 235d68b6..885c1d5a 100644 --- a/src/fdevent.h +++ b/src/fdevent.h @@ -1,9 +1,6 @@ #ifndef _FDEVENT_H_ #define _FDEVENT_H_ - -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif +#include "first.h" #include "settings.h" diff --git a/src/fdevent_freebsd_kqueue.c b/src/fdevent_freebsd_kqueue.c index 22845bec..b82ccfdf 100644 --- a/src/fdevent_freebsd_kqueue.c +++ b/src/fdevent_freebsd_kqueue.c @@ -1,3 +1,5 @@ +#include "first.h" + #include "fdevent.h" #include "buffer.h" #include "log.h" diff --git a/src/fdevent_libev.c b/src/fdevent_libev.c index fd5268cd..b0a4f77f 100644 --- a/src/fdevent_libev.c +++ b/src/fdevent_libev.c @@ -1,3 +1,5 @@ +#include "first.h" + #include "fdevent.h" #include "buffer.h" #include "log.h" diff --git a/src/fdevent_linux_sysepoll.c b/src/fdevent_linux_sysepoll.c index 9969d0eb..391833d4 100644 --- a/src/fdevent_linux_sysepoll.c +++ b/src/fdevent_linux_sysepoll.c @@ -1,3 +1,5 @@ +#include "first.h" + #include "fdevent.h" #include "buffer.h" #include "log.h" diff --git a/src/fdevent_poll.c b/src/fdevent_poll.c index ecd8627a..26fbd51b 100644 --- a/src/fdevent_poll.c +++ b/src/fdevent_poll.c @@ -1,3 +1,5 @@ +#include "first.h" + #include "fdevent.h" #include "buffer.h" #include "log.h" diff --git a/src/fdevent_select.c b/src/fdevent_select.c index 8e46aa43..356c3bd1 100644 --- a/src/fdevent_select.c +++ b/src/fdevent_select.c @@ -1,3 +1,5 @@ +#include "first.h" + #include "fdevent.h" #include "buffer.h" #include "log.h" diff --git a/src/fdevent_solaris_devpoll.c b/src/fdevent_solaris_devpoll.c index 88d7fb0c..c3b8f6e9 100644 --- a/src/fdevent_solaris_devpoll.c +++ b/src/fdevent_solaris_devpoll.c @@ -1,3 +1,5 @@ +#include "first.h" + #include "fdevent.h" #include "buffer.h" #include "log.h" diff --git a/src/fdevent_solaris_port.c b/src/fdevent_solaris_port.c index 073d3f77..3100d30d 100644 --- a/src/fdevent_solaris_port.c +++ b/src/fdevent_solaris_port.c @@ -1,3 +1,5 @@ +#include "first.h" + #include "fdevent.h" #include "buffer.h" #include "log.h" diff --git a/src/first.h b/src/first.h new file mode 100644 index 00000000..0efd0f0c --- /dev/null +++ b/src/first.h @@ -0,0 +1,12 @@ +#ifndef LI_FIRST_H +#define LI_FIRST_H + +#ifdef HAVE_CONFIG_H +# include "config.h" +#else +# ifndef _GNU_SOURCE +# define _GNU_SOURCE +# endif +#endif + +#endif diff --git a/src/http-header-glue.c b/src/http-header-glue.c index c0501f5b..992bef0f 100644 --- a/src/http-header-glue.c +++ b/src/http-header-glue.c @@ -1,3 +1,5 @@ +#include "first.h" + #include "base.h" #include "array.h" #include "buffer.h" diff --git a/src/http_auth.c b/src/http_auth.c index e5b351ef..851a3464 100644 --- a/src/http_auth.c +++ b/src/http_auth.c @@ -1,3 +1,5 @@ +#include "first.h" + #include "server.h" #include "log.h" #include "http_auth.h" diff --git a/src/http_auth.h b/src/http_auth.h index 081cef34..eb8d8f14 100644 --- a/src/http_auth.h +++ b/src/http_auth.h @@ -1,5 +1,6 @@ #ifndef _HTTP_AUTH_H_ #define _HTTP_AUTH_H_ +#include "first.h" #include "server.h" #include "plugin.h" diff --git a/src/http_chunk.c b/src/http_chunk.c index 45db56c4..18b32b30 100644 --- a/src/http_chunk.c +++ b/src/http_chunk.c @@ -1,3 +1,5 @@ +#include "first.h" + /** * the HTTP chunk-API * diff --git a/src/http_chunk.h b/src/http_chunk.h index 127a1162..eaa771a4 100644 --- a/src/http_chunk.h +++ b/src/http_chunk.h @@ -1,5 +1,6 @@ #ifndef _HTTP_CHUNK_H_ #define _HTTP_CHUNK_H_ +#include "first.h" #include "server.h" #include <sys/types.h> diff --git a/src/inet_ntop_cache.c b/src/inet_ntop_cache.c index eac0681d..3d921404 100644 --- a/src/inet_ntop_cache.c +++ b/src/inet_ntop_cache.c @@ -1,3 +1,5 @@ +#include "first.h" + #include "base.h" #include "inet_ntop_cache.h" #include "sys-socket.h" diff --git a/src/inet_ntop_cache.h b/src/inet_ntop_cache.h index fd3c2814..da2d3973 100644 --- a/src/inet_ntop_cache.h +++ b/src/inet_ntop_cache.h @@ -1,5 +1,6 @@ #ifndef _INET_NTOP_CACHE_H_ #define _INET_NTOP_CACHE_H_ +#include "first.h" #include "base.h" const char * inet_ntop_cache_get_ip(server *srv, sock_addr *addr); diff --git a/src/joblist.c b/src/joblist.c index bf4a26eb..85905b75 100644 --- a/src/joblist.c +++ b/src/joblist.c @@ -1,3 +1,5 @@ +#include "first.h" + #include "base.h" #include "joblist.h" #include "log.h" diff --git a/src/joblist.h b/src/joblist.h index 3701e097..7a6c95f8 100644 --- a/src/joblist.h +++ b/src/joblist.h @@ -1,5 +1,6 @@ #ifndef _JOB_LIST_H_ #define _JOB_LIST_H_ +#include "first.h" #include "base.h" diff --git a/src/keyvalue.c b/src/keyvalue.c index a43e1e8d..89673f97 100644 --- a/src/keyvalue.c +++ b/src/keyvalue.c @@ -1,3 +1,5 @@ +#include "first.h" + #include "server.h" #include "keyvalue.h" #include "log.h" diff --git a/src/keyvalue.h b/src/keyvalue.h index 02bbcac1..7a559b6f 100644 --- a/src/keyvalue.h +++ b/src/keyvalue.h @@ -1,9 +1,6 @@ #ifndef _KEY_VALUE_H_ #define _KEY_VALUE_H_ - -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif +#include "first.h" #ifdef HAVE_PCRE_H # include <pcre.h> diff --git a/src/lemon.c b/src/lemon.c index 2f72ef42..0b8d40a3 100644 --- a/src/lemon.c +++ b/src/lemon.c @@ -1,3 +1,5 @@ +#include "first.h" + /* ** This file contains all sources (including headers) to the LEMON ** LALR(1) parser generator. The sources have been combined into a @@ -12,10 +14,6 @@ #include <ctype.h> #include <stdlib.h> -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - #ifdef HAVE_STDINT_H # include <stdint.h> #endif diff --git a/src/lempar.c b/src/lempar.c index ef9bd94f..9c48fd20 100644 --- a/src/lempar.c +++ b/src/lempar.c @@ -3,6 +3,7 @@ */ /* First off, code is include which follows the "include" declaration ** in the input file. */ +#include "first.h" #include <stdio.h> %% /* Next is all token values, in a form suitable for use by makeheaders. diff --git a/src/lighttpd-angel.c b/src/lighttpd-angel.c index 948ca016..4c629a64 100644 --- a/src/lighttpd-angel.c +++ b/src/lighttpd-angel.c @@ -1,3 +1,5 @@ +#include "first.h" + /** * angel process for lighttpd * @@ -1,3 +1,5 @@ +#include "first.h" + #include "base.h" #include "log.h" #include "array.h" @@ -1,5 +1,6 @@ #ifndef _LOG_H_ #define _LOG_H_ +#include "first.h" #include "server.h" @@ -1,3 +1,5 @@ +#include "first.h" + /* MD5C.C - RSA Data Security, Inc., MD5 message-digest algorithm */ @@ -23,15 +25,12 @@ These notices must be retained in any copies of any part of this documentation and/or software. */ -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif + +#include "md5.h" #ifndef USE_OPENSSL #include <string.h> -#include "md5.h" - /* Constants for MD5Transform routine. */ @@ -1,3 +1,7 @@ +#ifndef LI_MD5_H +#define LI_MD5_H +#include "first.h" + /* MD5.H - header file for MD5C.C */ @@ -22,6 +26,7 @@ without express or implied warranty of any kind. These notices must be retained in any copies of any part of this documentation and/or software. */ + #include <limits.h> #ifdef HAVE_STDINT_H # include <stdint.h> @@ -44,3 +49,5 @@ typedef struct { void li_MD5_Init (li_MD5_CTX *); void li_MD5_Update (li_MD5_CTX *, const void *, unsigned int); void li_MD5_Final (unsigned char [16], li_MD5_CTX *); + +#endif diff --git a/src/mod_access.c b/src/mod_access.c index 4e7a349a..69d319f6 100644 --- a/src/mod_access.c +++ b/src/mod_access.c @@ -1,3 +1,5 @@ +#include "first.h" + #include "base.h" #include "log.h" #include "buffer.h" diff --git a/src/mod_accesslog.c b/src/mod_accesslog.c index a784401f..5433f046 100644 --- a/src/mod_accesslog.c +++ b/src/mod_accesslog.c @@ -1,3 +1,5 @@ +#include "first.h" + #include "base.h" #include "log.h" #include "buffer.h" diff --git a/src/mod_alias.c b/src/mod_alias.c index e761286b..0421d714 100644 --- a/src/mod_alias.c +++ b/src/mod_alias.c @@ -1,3 +1,5 @@ +#include "first.h" + #include "base.h" #include "log.h" #include "buffer.h" diff --git a/src/mod_auth.c b/src/mod_auth.c index 5b07e52f..5c6dae38 100644 --- a/src/mod_auth.c +++ b/src/mod_auth.c @@ -1,3 +1,5 @@ +#include "first.h" + #include "plugin.h" #include "http_auth.h" #include "log.h" diff --git a/src/mod_cgi.c b/src/mod_cgi.c index d3e02975..da521ba3 100644 --- a/src/mod_cgi.c +++ b/src/mod_cgi.c @@ -1,3 +1,5 @@ +#include "first.h" + #include "server.h" #include "stat_cache.h" #include "keyvalue.h" diff --git a/src/mod_cml.c b/src/mod_cml.c index 5d83aa60..28025f00 100644 --- a/src/mod_cml.c +++ b/src/mod_cml.c @@ -1,3 +1,5 @@ +#include "first.h" + #include "buffer.h" #include "server.h" #include "log.h" diff --git a/src/mod_cml.h b/src/mod_cml.h index 2639f428..e4adaed5 100644 --- a/src/mod_cml.h +++ b/src/mod_cml.h @@ -1,5 +1,6 @@ #ifndef _MOD_CACHE_H_ #define _MOD_CACHE_H_ +#include "first.h" #include "buffer.h" #include "server.h" diff --git a/src/mod_cml_funcs.c b/src/mod_cml_funcs.c index 38bae477..1dd0e50b 100644 --- a/src/mod_cml_funcs.c +++ b/src/mod_cml_funcs.c @@ -1,3 +1,5 @@ +#include "first.h" + #include "buffer.h" #include "server.h" #include "log.h" diff --git a/src/mod_cml_funcs.h b/src/mod_cml_funcs.h index f0695d7c..fd3069d7 100644 --- a/src/mod_cml_funcs.h +++ b/src/mod_cml_funcs.h @@ -1,9 +1,6 @@ #ifndef _MOD_CML_FUNCS_H_ #define _MOD_CML_FUNCS_H_ - -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif +#include "first.h" #ifdef HAVE_LUA_H #include <lua.h> diff --git a/src/mod_cml_lua.c b/src/mod_cml_lua.c index eff07d2e..6a1ac504 100644 --- a/src/mod_cml_lua.c +++ b/src/mod_cml_lua.c @@ -1,3 +1,5 @@ +#include "first.h" + #include "mod_cml.h" #include "mod_cml_funcs.h" #include "log.h" diff --git a/src/mod_compress.c b/src/mod_compress.c index 99ce151f..7aaf717e 100644 --- a/src/mod_compress.c +++ b/src/mod_compress.c @@ -1,3 +1,5 @@ +#include "first.h" + #include "base.h" #include "log.h" #include "buffer.h" diff --git a/src/mod_dirlisting.c b/src/mod_dirlisting.c index 0fed2ec8..9db14d69 100644 --- a/src/mod_dirlisting.c +++ b/src/mod_dirlisting.c @@ -1,3 +1,5 @@ +#include "first.h" + #include "base.h" #include "log.h" #include "buffer.h" diff --git a/src/mod_evasive.c b/src/mod_evasive.c index 35c64c0a..84b264af 100644 --- a/src/mod_evasive.c +++ b/src/mod_evasive.c @@ -1,3 +1,5 @@ +#include "first.h" + #include "base.h" #include "log.h" #include "buffer.h" diff --git a/src/mod_evhost.c b/src/mod_evhost.c index 908329bb..da3284de 100644 --- a/src/mod_evhost.c +++ b/src/mod_evhost.c @@ -1,3 +1,5 @@ +#include "first.h" + #include "plugin.h" #include "log.h" #include "response.h" diff --git a/src/mod_expire.c b/src/mod_expire.c index 1fcfec0e..22a875cf 100644 --- a/src/mod_expire.c +++ b/src/mod_expire.c @@ -1,3 +1,5 @@ +#include "first.h" + #include "base.h" #include "log.h" #include "buffer.h" diff --git a/src/mod_extforward.c b/src/mod_extforward.c index bbea336a..fdb3c11f 100644 --- a/src/mod_extforward.c +++ b/src/mod_extforward.c @@ -1,3 +1,5 @@ +#include "first.h" + #include "base.h" #include "log.h" #include "buffer.h" @@ -7,10 +9,6 @@ #include "inet_ntop_cache.h" #include "configfile.h" -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - #include <assert.h> #include <ctype.h> #include <stdlib.h> diff --git a/src/mod_fastcgi.c b/src/mod_fastcgi.c index d8708934..aca496e5 100644 --- a/src/mod_fastcgi.c +++ b/src/mod_fastcgi.c @@ -1,3 +1,5 @@ +#include "first.h" + #include "buffer.h" #include "server.h" #include "keyvalue.h" diff --git a/src/mod_flv_streaming.c b/src/mod_flv_streaming.c index 2a69cf5e..2cf4cd2e 100644 --- a/src/mod_flv_streaming.c +++ b/src/mod_flv_streaming.c @@ -1,3 +1,5 @@ +#include "first.h" + #include "base.h" #include "log.h" #include "buffer.h" diff --git a/src/mod_indexfile.c b/src/mod_indexfile.c index 652e74a4..c0027b41 100644 --- a/src/mod_indexfile.c +++ b/src/mod_indexfile.c @@ -1,3 +1,5 @@ +#include "first.h" + #include "base.h" #include "log.h" #include "buffer.h" diff --git a/src/mod_magnet.c b/src/mod_magnet.c index b53a621a..2b350795 100644 --- a/src/mod_magnet.c +++ b/src/mod_magnet.c @@ -1,3 +1,5 @@ +#include "first.h" + #include "base.h" #include "log.h" #include "buffer.h" diff --git a/src/mod_magnet_cache.c b/src/mod_magnet_cache.c index 3804cb80..befc19cb 100644 --- a/src/mod_magnet_cache.c +++ b/src/mod_magnet_cache.c @@ -1,3 +1,5 @@ +#include "first.h" + #include "mod_magnet_cache.h" #include "stat_cache.h" diff --git a/src/mod_magnet_cache.h b/src/mod_magnet_cache.h index 50c9e44a..96f4d787 100644 --- a/src/mod_magnet_cache.h +++ b/src/mod_magnet_cache.h @@ -1,5 +1,6 @@ #ifndef _MOD_MAGNET_CACHE_H_ #define _MOD_MAGNET_CACHE_H_ +#include "first.h" #include "buffer.h" #include "base.h" diff --git a/src/mod_mysql_vhost.c b/src/mod_mysql_vhost.c index 06fe2828..69050890 100644 --- a/src/mod_mysql_vhost.c +++ b/src/mod_mysql_vhost.c @@ -1,13 +1,11 @@ +#include "first.h" + #include <unistd.h> #include <stdio.h> #include <errno.h> #include <fcntl.h> #include <strings.h> -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - #ifdef HAVE_MYSQL #include <mysql.h> #endif diff --git a/src/mod_proxy.c b/src/mod_proxy.c index bc4f939b..6c4d2bc5 100644 --- a/src/mod_proxy.c +++ b/src/mod_proxy.c @@ -1,3 +1,5 @@ +#include "first.h" + #include "buffer.h" #include "server.h" #include "keyvalue.h" diff --git a/src/mod_redirect.c b/src/mod_redirect.c index c72c1d37..5e99dcb5 100644 --- a/src/mod_redirect.c +++ b/src/mod_redirect.c @@ -1,3 +1,5 @@ +#include "first.h" + #include "base.h" #include "log.h" #include "buffer.h" diff --git a/src/mod_rewrite.c b/src/mod_rewrite.c index 56d55162..fac6c49f 100644 --- a/src/mod_rewrite.c +++ b/src/mod_rewrite.c @@ -1,3 +1,5 @@ +#include "first.h" + #include "base.h" #include "log.h" #include "buffer.h" diff --git a/src/mod_rrdtool.c b/src/mod_rrdtool.c index b0c41729..eee69080 100644 --- a/src/mod_rrdtool.c +++ b/src/mod_rrdtool.c @@ -1,3 +1,5 @@ +#include "first.h" + #include "server.h" #include "connections.h" #include "response.h" diff --git a/src/mod_scgi.c b/src/mod_scgi.c index 0bd96c34..47aadd35 100644 --- a/src/mod_scgi.c +++ b/src/mod_scgi.c @@ -1,3 +1,5 @@ +#include "first.h" + #include "buffer.h" #include "server.h" #include "keyvalue.h" diff --git a/src/mod_secdownload.c b/src/mod_secdownload.c index 30353648..540020e2 100644 --- a/src/mod_secdownload.c +++ b/src/mod_secdownload.c @@ -1,3 +1,5 @@ +#include "first.h" + #include "base.h" #include "log.h" #include "buffer.h" diff --git a/src/mod_setenv.c b/src/mod_setenv.c index 04d9a1a4..81c45e3d 100644 --- a/src/mod_setenv.c +++ b/src/mod_setenv.c @@ -1,3 +1,5 @@ +#include "first.h" + #include "base.h" #include "log.h" #include "buffer.h" diff --git a/src/mod_simple_vhost.c b/src/mod_simple_vhost.c index 2d0daec8..6ffdc769 100644 --- a/src/mod_simple_vhost.c +++ b/src/mod_simple_vhost.c @@ -1,3 +1,5 @@ +#include "first.h" + #include "base.h" #include "log.h" #include "buffer.h" diff --git a/src/mod_skeleton.c b/src/mod_skeleton.c index d1819ffa..77fd53cf 100644 --- a/src/mod_skeleton.c +++ b/src/mod_skeleton.c @@ -1,3 +1,5 @@ +#include "first.h" + #include "base.h" #include "log.h" #include "buffer.h" diff --git a/src/mod_ssi.c b/src/mod_ssi.c index f3f255b7..a34e2c90 100644 --- a/src/mod_ssi.c +++ b/src/mod_ssi.c @@ -1,3 +1,5 @@ +#include "first.h" + #include "base.h" #include "log.h" #include "buffer.h" diff --git a/src/mod_ssi.h b/src/mod_ssi.h index 241e8320..aeff85e4 100644 --- a/src/mod_ssi.h +++ b/src/mod_ssi.h @@ -1,5 +1,6 @@ #ifndef _MOD_SSI_H_ #define _MOD_SSI_H_ +#include "first.h" #include "base.h" #include "buffer.h" diff --git a/src/mod_ssi_expr.c b/src/mod_ssi_expr.c index 256c960a..60e97cc3 100644 --- a/src/mod_ssi_expr.c +++ b/src/mod_ssi_expr.c @@ -1,3 +1,5 @@ +#include "first.h" + #include "buffer.h" #include "log.h" #include "mod_ssi.h" diff --git a/src/mod_ssi_expr.h b/src/mod_ssi_expr.h index 4df9d81d..17cd73ec 100644 --- a/src/mod_ssi_expr.h +++ b/src/mod_ssi_expr.h @@ -1,5 +1,6 @@ #ifndef _MOD_SSI_EXPR_H_ #define _MOD_SSI_EXPR_H_ +#include "first.h" #include "buffer.h" diff --git a/src/mod_ssi_exprparser.y b/src/mod_ssi_exprparser.y index f4aaa967..ee40912b 100644 --- a/src/mod_ssi_exprparser.y +++ b/src/mod_ssi_exprparser.y @@ -4,6 +4,7 @@ %name ssiexprparser %include { +#include "first.h" #include "mod_ssi_expr.h" #include "buffer.h" diff --git a/src/mod_staticfile.c b/src/mod_staticfile.c index 6560c975..5bfa3b93 100644 --- a/src/mod_staticfile.c +++ b/src/mod_staticfile.c @@ -1,3 +1,5 @@ +#include "first.h" + #include "base.h" #include "log.h" #include "buffer.h" diff --git a/src/mod_status.c b/src/mod_status.c index 3bfb7f5c..90308ef5 100644 --- a/src/mod_status.c +++ b/src/mod_status.c @@ -1,3 +1,5 @@ +#include "first.h" + #include "server.h" #include "connections.h" #include "response.h" diff --git a/src/mod_trigger_b4_dl.c b/src/mod_trigger_b4_dl.c index 54b29af9..fc999764 100644 --- a/src/mod_trigger_b4_dl.c +++ b/src/mod_trigger_b4_dl.c @@ -1,3 +1,5 @@ +#include "first.h" + #include "base.h" #include "log.h" #include "buffer.h" diff --git a/src/mod_uploadprogress.c b/src/mod_uploadprogress.c index 0c4f001c..2772b80e 100644 --- a/src/mod_uploadprogress.c +++ b/src/mod_uploadprogress.c @@ -1,3 +1,5 @@ +#include "first.h" + #include "base.h" #include "log.h" #include "buffer.h" diff --git a/src/mod_userdir.c b/src/mod_userdir.c index da2912d4..377edcdc 100644 --- a/src/mod_userdir.c +++ b/src/mod_userdir.c @@ -1,3 +1,5 @@ +#include "first.h" + #include "base.h" #include "log.h" #include "buffer.h" diff --git a/src/mod_usertrack.c b/src/mod_usertrack.c index eacef0fc..b65d9001 100644 --- a/src/mod_usertrack.c +++ b/src/mod_usertrack.c @@ -1,3 +1,5 @@ +#include "first.h" + #include "base.h" #include "log.h" #include "buffer.h" diff --git a/src/mod_webdav.c b/src/mod_webdav.c index 445f4e22..925a7c86 100644 --- a/src/mod_webdav.c +++ b/src/mod_webdav.c @@ -1,3 +1,5 @@ +#include "first.h" + #include "base.h" #include "log.h" #include "buffer.h" diff --git a/src/network.c b/src/network.c index a6022e81..0f66ebca 100644 --- a/src/network.c +++ b/src/network.c @@ -1,3 +1,5 @@ +#include "first.h" + #include "network.h" #include "fdevent.h" #include "log.h" diff --git a/src/network.h b/src/network.h index d9d4e7a2..c478c423 100644 --- a/src/network.h +++ b/src/network.h @@ -1,5 +1,6 @@ #ifndef _NETWORK_H_ #define _NETWORK_H_ +#include "first.h" #include "server.h" diff --git a/src/network_backends.h b/src/network_backends.h index b1ff6088..9537663c 100644 --- a/src/network_backends.h +++ b/src/network_backends.h @@ -1,9 +1,7 @@ #ifndef _NETWORK_BACKENDS_H_ #define _NETWORK_BACKENDS_H_ +#include "first.h" -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif #include "settings.h" #include <sys/types.h> diff --git a/src/network_darwin_sendfile.c b/src/network_darwin_sendfile.c index a249d72a..061bbd96 100644 --- a/src/network_darwin_sendfile.c +++ b/src/network_darwin_sendfile.c @@ -1,3 +1,5 @@ +#include "first.h" + #include "network_backends.h" #if defined(USE_DARWIN_SENDFILE) diff --git a/src/network_freebsd_sendfile.c b/src/network_freebsd_sendfile.c index c9711b69..1ddf8706 100644 --- a/src/network_freebsd_sendfile.c +++ b/src/network_freebsd_sendfile.c @@ -1,3 +1,5 @@ +#include "first.h" + #include "network_backends.h" #if defined(USE_FREEBSD_SENDFILE) diff --git a/src/network_linux_sendfile.c b/src/network_linux_sendfile.c index 4e12b2db..8d5b9103 100644 --- a/src/network_linux_sendfile.c +++ b/src/network_linux_sendfile.c @@ -1,3 +1,5 @@ +#include "first.h" + #include "network_backends.h" #if defined(USE_LINUX_SENDFILE) diff --git a/src/network_openssl.c b/src/network_openssl.c index b731a1f2..4cf2cc48 100644 --- a/src/network_openssl.c +++ b/src/network_openssl.c @@ -1,3 +1,5 @@ +#include "first.h" + #include "network_backends.h" #if defined(USE_OPENSSL) diff --git a/src/network_solaris_sendfilev.c b/src/network_solaris_sendfilev.c index 676e122d..17a36b1e 100644 --- a/src/network_solaris_sendfilev.c +++ b/src/network_solaris_sendfilev.c @@ -1,3 +1,5 @@ +#include "first.h" + #include "network_backends.h" #if defined(USE_SOLARIS_SENDFILEV) diff --git a/src/network_write.c b/src/network_write.c index 2c61cf79..13447d9b 100644 --- a/src/network_write.c +++ b/src/network_write.c @@ -1,3 +1,5 @@ +#include "first.h" + #include "network_backends.h" #include "network.h" diff --git a/src/network_write_mmap.c b/src/network_write_mmap.c index 445ea390..83add942 100644 --- a/src/network_write_mmap.c +++ b/src/network_write_mmap.c @@ -1,3 +1,5 @@ +#include "first.h" + #include "network_backends.h" #include "network.h" diff --git a/src/network_write_no_mmap.c b/src/network_write_no_mmap.c index f5f50cea..834ca94a 100644 --- a/src/network_write_no_mmap.c +++ b/src/network_write_no_mmap.c @@ -1,3 +1,5 @@ +#include "first.h" + #include "network_backends.h" #include "network.h" diff --git a/src/network_writev.c b/src/network_writev.c index 121f7822..28edf589 100644 --- a/src/network_writev.c +++ b/src/network_writev.c @@ -1,3 +1,5 @@ +#include "first.h" + #include "network_backends.h" #if defined(USE_WRITEV) diff --git a/src/plugin.c b/src/plugin.c index 7c162017..ad27f58e 100644 --- a/src/plugin.c +++ b/src/plugin.c @@ -1,3 +1,5 @@ +#include "first.h" + #include "plugin.h" #include "log.h" diff --git a/src/plugin.h b/src/plugin.h index b758b179..b9c83503 100644 --- a/src/plugin.h +++ b/src/plugin.h @@ -1,5 +1,6 @@ #ifndef _PLUGIN_H_ #define _PLUGIN_H_ +#include "first.h" #include "base.h" #include "buffer.h" diff --git a/src/proc_open.c b/src/proc_open.c index 167027a2..2023443d 100644 --- a/src/proc_open.c +++ b/src/proc_open.c @@ -1,3 +1,5 @@ +#include "first.h" + #include "proc_open.h" #include <stdlib.h> diff --git a/src/proc_open.h b/src/proc_open.h index af707383..e4b022bf 100644 --- a/src/proc_open.h +++ b/src/proc_open.h @@ -1,3 +1,6 @@ +#ifndef LI_PROC_OPEN_H +#define LI_PROC_OPEN_H +#include "first.h" #include "buffer.h" @@ -23,3 +26,5 @@ typedef struct { int proc_close(proc_handler_t *ht); int proc_open(proc_handler_t *ht, const char *command); int proc_open_buffer(const char *command, buffer *in, buffer *out, buffer *err); + +#endif diff --git a/src/request.c b/src/request.c index 993cb286..f75574fa 100644 --- a/src/request.c +++ b/src/request.c @@ -1,3 +1,5 @@ +#include "first.h" + #include "request.h" #include "keyvalue.h" #include "log.h" diff --git a/src/request.h b/src/request.h index cf2b07d4..bb05bcd7 100644 --- a/src/request.h +++ b/src/request.h @@ -1,5 +1,6 @@ #ifndef _REQUEST_H_ #define _REQUEST_H_ +#include "first.h" #include "server.h" diff --git a/src/response.c b/src/response.c index be037a55..3763f26b 100644 --- a/src/response.c +++ b/src/response.c @@ -1,3 +1,5 @@ +#include "first.h" + #include "response.h" #include "keyvalue.h" #include "log.h" diff --git a/src/response.h b/src/response.h index 289add89..e493a1c9 100644 --- a/src/response.h +++ b/src/response.h @@ -1,5 +1,6 @@ #ifndef _RESPONSE_H_ #define _RESPONSE_H_ +#include "first.h" #include "server.h" diff --git a/src/safe_memclear.c b/src/safe_memclear.c index cec39b75..ada33142 100644 --- a/src/safe_memclear.c +++ b/src/safe_memclear.c @@ -1,6 +1,5 @@ -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif +#include "first.h" + #include "settings.h" #include "safe_memclear.h" diff --git a/src/safe_memclear.h b/src/safe_memclear.h index 7c22a4d3..0baf8954 100644 --- a/src/safe_memclear.h +++ b/src/safe_memclear.h @@ -1,5 +1,6 @@ #ifndef _SAFE_MEMCLEAR_H_ #define _SAFE_MEMCLEAR_H_ +#include "first.h" /* size_t */ #include <sys/types.h> diff --git a/src/server.c b/src/server.c index 0218cd24..bd2289c9 100644 --- a/src/server.c +++ b/src/server.c @@ -1,3 +1,5 @@ +#include "first.h" + #include "server.h" #include "buffer.h" #include "network.h" diff --git a/src/server.h b/src/server.h index 67d4e7ca..9fe03256 100644 --- a/src/server.h +++ b/src/server.h @@ -1,5 +1,6 @@ #ifndef _SERVER_H_ #define _SERVER_H_ +#include "first.h" #include "base.h" diff --git a/src/settings.h b/src/settings.h index 12a7afc7..2129e42e 100644 --- a/src/settings.h +++ b/src/settings.h @@ -1,13 +1,6 @@ #ifndef _LIGHTTPD_SETTINGS_H_ #define _LIGHTTPD_SETTINGS_H_ - -#ifndef _GNU_SOURCE -# define _GNU_SOURCE -#endif - -#ifndef __USE_GNU -# define __USE_GNU /* a hack in my eyes, <fcntl.h> F_SETSIG should work with _GNU_SOURCE */ -#endif +#include "first.h" #ifdef __GNUC__ # define LI_NORETURN __attribute__((noreturn)) @@ -53,13 +46,4 @@ typedef enum { HANDLER_UNSET, #define HTTP_LINGER_TIMEOUT 5 -/* we use it in a enum */ -#ifdef TRUE -#undef TRUE -#endif - -#ifdef FALSE -#undef FALSE -#endif - #endif diff --git a/src/splaytree.h b/src/splaytree.h index 4be1523a..cc5fe9b1 100644 --- a/src/splaytree.h +++ b/src/splaytree.h @@ -1,5 +1,6 @@ #ifndef _SPLAY_TREE_H_ #define _SPLAY_TREE_H_ +#include "first.h" typedef struct tree_node { struct tree_node * left, * right; diff --git a/src/stat_cache.c b/src/stat_cache.c index 18bf4c3c..c82c9801 100644 --- a/src/stat_cache.c +++ b/src/stat_cache.c @@ -1,3 +1,5 @@ +#include "first.h" + #include "log.h" #include "stat_cache.h" #include "fdevent.h" diff --git a/src/stat_cache.h b/src/stat_cache.h index 7b80cce5..5c22e49a 100644 --- a/src/stat_cache.h +++ b/src/stat_cache.h @@ -1,5 +1,6 @@ #ifndef _FILE_CACHE_H_ #define _FILE_CACHE_H_ +#include "first.h" #include "base.h" diff --git a/src/status_counter.c b/src/status_counter.c index ab130dad..0dc267c9 100644 --- a/src/status_counter.c +++ b/src/status_counter.c @@ -1,3 +1,5 @@ +#include "first.h" + #include "status_counter.h" #include <stdlib.h> diff --git a/src/status_counter.h b/src/status_counter.h index ba5e76f3..5b1ad00f 100644 --- a/src/status_counter.h +++ b/src/status_counter.h @@ -1,5 +1,6 @@ #ifndef _STATUS_COUNTER_H_ #define _STATUS_COUNTER_H_ +#include "first.h" #include "array.h" #include "base.h" diff --git a/src/stream.c b/src/stream.c index 30112caf..51a27676 100644 --- a/src/stream.c +++ b/src/stream.c @@ -1,3 +1,5 @@ +#include "first.h" + #include "stream.h" #include <sys/types.h> diff --git a/src/stream.h b/src/stream.h index d4c9049b..11c42f97 100644 --- a/src/stream.h +++ b/src/stream.h @@ -1,5 +1,6 @@ #ifndef _STREAM_H_ #define _STREAM_H_ +#include "first.h" #include "buffer.h" diff --git a/src/sys-mmap.h b/src/sys-mmap.h index 288ac90e..51232ab5 100644 --- a/src/sys-mmap.h +++ b/src/sys-mmap.h @@ -1,5 +1,6 @@ #ifndef LI_SYS_MMAP_H #define LI_SYS_MMAP_H +#include "first.h" #if defined(HAVE_SYS_MMAN_H) # include <sys/mman.h> diff --git a/src/sys-socket.h b/src/sys-socket.h index f35699da..04c9d949 100644 --- a/src/sys-socket.h +++ b/src/sys-socket.h @@ -1,5 +1,6 @@ #ifndef WIN32_SOCKET_H #define WIN32_SOCKET_H +#include "first.h" #ifdef __WIN32 diff --git a/src/version.h b/src/version.h index e05b6545..c1e4ee00 100644 --- a/src/version.h +++ b/src/version.h @@ -1,5 +1,6 @@ #ifndef _VERSION_H_ #define _VERSION_H_ +#include "first.h" #ifdef HAVE_VERSION_H # include "versionstamp.h" |