Apache HTTPD
ap_config.h
Go to the documentation of this file.
1/* Licensed to the Apache Software Foundation (ASF) under one or more
2 * contributor license agreements. See the NOTICE file distributed with
3 * this work for additional information regarding copyright ownership.
4 * The ASF licenses this file to You under the Apache License, Version 2.0
5 * (the "License"); you may not use this file except in compliance with
6 * the License. You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
22#ifndef AP_CONFIG_H
23#define AP_CONFIG_H
24
25#include "ap_hooks.h"
26
27/* Although this file doesn't declare any hooks, declare the exports group here */
33#ifdef DOXYGEN
34/* define these just so doxygen documents them */
35
47# define AP_DECLARE_STATIC
54# define AP_DECLARE_EXPORT
55
56#endif /* def DOXYGEN */
57
58#if !defined(WIN32)
67#define AP_DECLARE(type) type
68
77#define AP_DECLARE_NONSTD(type) type
78
89#define AP_DECLARE_DATA
90
91#elif defined(AP_DECLARE_STATIC)
92#define AP_DECLARE(type) type __stdcall
93#define AP_DECLARE_NONSTD(type) type
94#define AP_DECLARE_DATA
95#elif defined(AP_DECLARE_EXPORT)
96#define AP_DECLARE(type) __declspec(dllexport) type __stdcall
97#define AP_DECLARE_NONSTD(type) __declspec(dllexport) type
98#define AP_DECLARE_DATA __declspec(dllexport)
99#else
100#define AP_DECLARE(type) __declspec(dllimport) type __stdcall
101#define AP_DECLARE_NONSTD(type) __declspec(dllimport) type
102#define AP_DECLARE_DATA __declspec(dllimport)
103#endif
104
105#if !defined(WIN32) || defined(AP_MODULE_DECLARE_STATIC)
115#if defined(WIN32)
116#define AP_MODULE_DECLARE(type) type __stdcall
117#else
118#define AP_MODULE_DECLARE(type) type
119#endif
120#define AP_MODULE_DECLARE_NONSTD(type) type
121#define AP_MODULE_DECLARE_DATA
122#else
130#define AP_MODULE_DECLARE_EXPORT
131#define AP_MODULE_DECLARE(type) __declspec(dllexport) type __stdcall
132#define AP_MODULE_DECLARE_NONSTD(type) __declspec(dllexport) type
133#define AP_MODULE_DECLARE_DATA __declspec(dllexport)
134#endif
135
136#include "os.h"
137#if (!defined(WIN32) && !defined(NETWARE)) || defined(__MINGW32__)
138#include "ap_config_auto.h"
139#endif
140#include "ap_config_layout.h"
141
142/* Where the main/parent process's pid is logged */
143#ifndef DEFAULT_PIDLOG
144#define DEFAULT_PIDLOG DEFAULT_REL_RUNTIMEDIR "/httpd.pid"
145#endif
146
147#if defined(NETWARE)
148#define AP_NONBLOCK_WHEN_MULTI_LISTEN 1
149#endif
150
151#if defined(AP_ENABLE_DTRACE) && HAVE_SYS_SDT_H
152#include <sys/sdt.h>
153#else
154#undef _DTRACE_VERSION
155#endif
156
157#ifdef _DTRACE_VERSION
158#include "apache_probes.h"
159#else
160#include "apache_noprobes.h"
161#endif
162
163/* If APR has OTHER_CHILD logic, use reliable piped logs. */
164#if APR_HAS_OTHER_CHILD
165#define AP_HAVE_RELIABLE_PIPED_LOGS TRUE
166#endif
167
168#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
169#define AP_HAVE_C99
170#endif
171
172/* Presume that the compiler supports C99-style designated
173 * initializers if using GCC (but not G++), or for any other compiler
174 * which claims C99 support. */
175#if (defined(__GNUC__) && !defined(__cplusplus)) || defined(AP_HAVE_C99)
176#define AP_HAVE_DESIGNATED_INITIALIZER
177#endif
178
179#ifndef __has_attribute /* check for supported attributes on clang */
180#define __has_attribute(x) 0
181#endif
182#if (defined(__GNUC__) && __GNUC__ >= 4) || __has_attribute(sentinel)
183#define AP_FN_ATTR_SENTINEL __attribute__((sentinel))
184#else
185#define AP_FN_ATTR_SENTINEL
186#endif
187
188#if ( defined(__GNUC__) && \
189 (__GNUC__ >= 4 || ( __GNUC__ == 3 && __GNUC_MINOR__ >= 4))) \
190 || __has_attribute(warn_unused_result)
191#define AP_FN_ATTR_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
192#else
193#define AP_FN_ATTR_WARN_UNUSED_RESULT
194#endif
195
196#if ( defined(__GNUC__) && \
197 (__GNUC__ >= 4 && __GNUC_MINOR__ >= 3)) \
198 || __has_attribute(alloc_size)
199#define AP_FN_ATTR_ALLOC_SIZE(x) __attribute__((alloc_size(x)))
200#define AP_FN_ATTR_ALLOC_SIZE2(x,y) __attribute__((alloc_size(x,y)))
201#else
202#define AP_FN_ATTR_ALLOC_SIZE(x)
203#define AP_FN_ATTR_ALLOC_SIZE2(x,y)
204#endif
205
206#endif /* AP_CONFIG_H */
ap hook functions and macros