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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
21 /* GENERATED FILE WARNING! DO NOT EDIT apr.h
23 * You must modify apr.h.in instead.
25 * And please, make an effort to stub apr.hw and apr.hnw in the process.
30 * @brief APR Platform Definitions
31 * @remark This is a generated header generated from include/apr.h.in by
32 * ./configure, or copied from include/apr.hw or include/apr.hnw
33 * for Win32 or Netware by those build environments, respectively.
37 * @defgroup APR Apache Portability Runtime library
41 * @defgroup apr_platform Platform Definitions
44 * <strong><em>The actual values of macros and typedefs on this page<br>
45 * are platform specific and should NOT be relied upon!</em></strong>
48 /* So that we can use inline on some critical functions, and use
49 * GNUC attributes (such as to get -Wall warnings for printf-like
50 * functions). Only do this in gcc 2.7 or later ... it may work
51 * on earlier stuff, but why chance it.
53 * We've since discovered that the gcc shipped with NeXT systems
54 * as "cc" is completely broken. It claims to be __GNUC__ and so
55 * on, but it doesn't implement half of the things that __GNUC__
56 * means. In particular it's missing inline and the __attribute__
57 * stuff. So we hack around it. PR#1613. -djg
59 #if !defined(__GNUC__) || __GNUC__ < 2 || \
60 (__GNUC__ == 2 && __GNUC_MINOR__ < 7) ||\
63 #define __attribute__(__x)
66 #define APR_HAS_INLINE 0
68 #define APR_INLINE __inline__
69 #define APR_HAS_INLINE 1
72 #define APR_HAVE_ARPA_INET_H @arpa_ineth@
73 #define APR_HAVE_CONIO_H @conioh@
74 #define APR_HAVE_CRYPT_H @crypth@
75 #define APR_HAVE_CTYPE_H @ctypeh@
76 #define APR_HAVE_DIRENT_H @direnth@
77 #define APR_HAVE_ERRNO_H @errnoh@
78 #define APR_HAVE_FCNTL_H @fcntlh@
79 #define APR_HAVE_IO_H @ioh@
80 #define APR_HAVE_LIMITS_H @limitsh@
81 #define APR_HAVE_NETDB_H @netdbh@
82 #define APR_HAVE_NETINET_IN_H @netinet_inh@
83 #define APR_HAVE_NETINET_SCTP_H @netinet_sctph@
84 #define APR_HAVE_NETINET_SCTP_UIO_H @netinet_sctp_uioh@
85 #define APR_HAVE_NETINET_TCP_H @netinet_tcph@
86 #define APR_HAVE_PTHREAD_H @pthreadh@
87 #define APR_HAVE_SEMAPHORE_H @semaphoreh@
88 #define APR_HAVE_SIGNAL_H @signalh@
89 #define APR_HAVE_STDARG_H @stdargh@
90 #define APR_HAVE_STDINT_H @stdint@
91 #define APR_HAVE_STDIO_H @stdioh@
92 #define APR_HAVE_STDLIB_H @stdlibh@
93 #define APR_HAVE_STRING_H @stringh@
94 #define APR_HAVE_STRINGS_H @stringsh@
95 #define APR_HAVE_SYS_IOCTL_H @sys_ioctlh@
96 #define APR_HAVE_SYS_SENDFILE_H @sys_sendfileh@
97 #define APR_HAVE_SYS_SIGNAL_H @sys_signalh@
98 #define APR_HAVE_SYS_SOCKET_H @sys_socketh@
99 #define APR_HAVE_SYS_SOCKIO_H @sys_sockioh@
100 #define APR_HAVE_SYS_SYSLIMITS_H @sys_syslimitsh@
101 #define APR_HAVE_SYS_TIME_H @sys_timeh@
102 #define APR_HAVE_SYS_TYPES_H @sys_typesh@
103 #define APR_HAVE_SYS_UIO_H @sys_uioh@
104 #define APR_HAVE_SYS_UN_H @sys_unh@
105 #define APR_HAVE_SYS_WAIT_H @sys_waith@
106 #define APR_HAVE_TIME_H @timeh@
107 #define APR_HAVE_UNISTD_H @unistdh@
111 /* We don't include our conditional headers within the doxyblocks
112 * or the extern "C" namespace
115 #if APR_HAVE_SYS_TYPES_H
116 #include <sys/types.h>
119 #if APR_HAVE_SYS_SOCKET_H
120 #include <sys/socket.h>
123 #if defined(__cplusplus) && !defined(__STDC_CONSTANT_MACROS)
124 /* C99 7.18.4 requires that stdint.h only exposes INT64_C
125 * and UINT64_C for C++ implementations if this is defined: */
126 #define __STDC_CONSTANT_MACROS
129 #if APR_HAVE_STDINT_H
133 #if APR_HAVE_SYS_WAIT_H
134 #include <sys/wait.h>
139 #define INCL_DOSERRORS
143 /* header files for PATH_MAX, _POSIX_PATH_MAX */
144 #if APR_HAVE_LIMITS_H
147 #if APR_HAVE_SYS_SYSLIMITS_H
148 #include <sys/syslimits.h>
158 * @addtogroup apr_platform
163 #define APR_HAVE_SHMEM_MMAP_TMP @havemmaptmp@
164 #define APR_HAVE_SHMEM_MMAP_SHM @havemmapshm@
165 #define APR_HAVE_SHMEM_MMAP_ZERO @havemmapzero@
166 #define APR_HAVE_SHMEM_SHMGET_ANON @haveshmgetanon@
167 #define APR_HAVE_SHMEM_SHMGET @haveshmget@
168 #define APR_HAVE_SHMEM_MMAP_ANON @havemmapanon@
169 #define APR_HAVE_SHMEM_BEOS @havebeosarea@
171 #define APR_USE_SHMEM_MMAP_TMP @usemmaptmp@
172 #define APR_USE_SHMEM_MMAP_SHM @usemmapshm@
173 #define APR_USE_SHMEM_MMAP_ZERO @usemmapzero@
174 #define APR_USE_SHMEM_SHMGET_ANON @useshmgetanon@
175 #define APR_USE_SHMEM_SHMGET @useshmget@
176 #define APR_USE_SHMEM_MMAP_ANON @usemmapanon@
177 #define APR_USE_SHMEM_BEOS @usebeosarea@
179 #define APR_USE_FLOCK_SERIALIZE @flockser@
180 #define APR_USE_SYSVSEM_SERIALIZE @sysvser@
181 #define APR_USE_POSIXSEM_SERIALIZE @posixser@
182 #define APR_USE_FCNTL_SERIALIZE @fcntlser@
183 #define APR_USE_PROC_PTHREAD_SERIALIZE @procpthreadser@
184 #define APR_USE_PTHREAD_SERIALIZE @pthreadser@
186 #define APR_HAS_FLOCK_SERIALIZE @hasflockser@
187 #define APR_HAS_SYSVSEM_SERIALIZE @hassysvser@
188 #define APR_HAS_POSIXSEM_SERIALIZE @hasposixser@
189 #define APR_HAS_FCNTL_SERIALIZE @hasfcntlser@
190 #define APR_HAS_PROC_PTHREAD_SERIALIZE @hasprocpthreadser@
191 #define APR_HAS_RWLOCK_SERIALIZE @hasrwlockser@
193 #define APR_PROCESS_LOCK_IS_GLOBAL @proclockglobal@
195 #define APR_HAVE_CORKABLE_TCP @have_corkable_tcp@
196 #define APR_HAVE_GETRLIMIT @have_getrlimit@
197 #define APR_HAVE_IN_ADDR @have_in_addr@
198 #define APR_HAVE_INET_ADDR @have_inet_addr@
199 #define APR_HAVE_INET_NETWORK @have_inet_network@
200 #define APR_HAVE_IPV6 @have_ipv6@
201 #define APR_HAVE_MEMMOVE @have_memmove@
202 #define APR_HAVE_SETRLIMIT @have_setrlimit@
203 #define APR_HAVE_SIGACTION @have_sigaction@
204 #define APR_HAVE_SIGSUSPEND @have_sigsuspend@
205 #define APR_HAVE_SIGWAIT @have_sigwait@
206 #define APR_HAVE_STRCASECMP @have_strcasecmp@
207 #define APR_HAVE_STRDUP @have_strdup@
208 #define APR_HAVE_STRICMP @have_stricmp@
209 #define APR_HAVE_STRNCASECMP @have_strncasecmp@
210 #define APR_HAVE_STRNICMP @have_strnicmp@
211 #define APR_HAVE_STRSTR @have_strstr@
212 #define APR_HAVE_MEMCHR @have_memchr@
213 #define APR_HAVE_STRUCT_RLIMIT @struct_rlimit@
214 #define APR_HAVE_UNION_SEMUN @have_union_semun@
215 #define APR_HAVE_SCTP @have_sctp@
217 /* APR Feature Macros */
218 #define APR_HAS_SHARED_MEMORY @sharedmem@
219 #define APR_HAS_THREADS @threads@
220 #define APR_HAS_SENDFILE @sendfile@
221 #define APR_HAS_MMAP @mmap@
222 #define APR_HAS_FORK @fork@
223 #define APR_HAS_RANDOM @rand@
224 #define APR_HAS_OTHER_CHILD @oc@
225 #define APR_HAS_DSO @aprdso@
226 #define APR_HAS_SO_ACCEPTFILTER @acceptfilter@
227 #define APR_HAS_UNICODE_FS 0
228 #define APR_HAS_PROC_INVOKED 0
229 #define APR_HAS_USER 1
230 #define APR_HAS_LARGE_FILES 0
231 #define APR_HAS_XTHREAD_FILES 0
232 #define APR_HAS_OS_UUID 0
234 /* APR sets APR_FILES_AS_SOCKETS to 1 on systems where it is possible
235 * to poll on files/pipes. On such a system, the application can
236 * call apr_socket_from_file() to get an APR socket representation and
237 * then pass the socket representation to apr_poll_socket_add().
239 #define APR_FILES_AS_SOCKETS @file_as_socket@
241 /* Not all platforms have a real INADDR_NONE. This macro replaces INADDR_NONE
244 #define APR_INADDR_NONE @apr_inaddr_none@
246 /* This macro indicates whether or not EBCDIC is the native character set.
248 #define APR_CHARSET_EBCDIC @apr_charset_ebcdic@
250 /* If we have a TCP implementation that can be "corked", what flag
253 #define APR_TCP_NOPUSH_FLAG @apr_tcp_nopush_flag@
255 /* Is the TCP_NODELAY socket option inherited from listening sockets?
257 #define APR_TCP_NODELAY_INHERITED @tcp_nodelay_inherited@
259 /* Is the O_NONBLOCK flag inherited from listening sockets?
261 #define APR_O_NONBLOCK_INHERITED @o_nonblock_inherited@
263 /* Typedefs that APR needs. */
265 typedef unsigned char apr_byte_t;
267 typedef @short_value@ apr_int16_t;
268 typedef unsigned @short_value@ apr_uint16_t;
270 typedef @int_value@ apr_int32_t;
271 typedef unsigned @int_value@ apr_uint32_t;
273 typedef @long_value@ apr_int64_t;
274 typedef unsigned @long_value@ apr_uint64_t;
276 typedef @size_t_value@ apr_size_t;
277 typedef @ssize_t_value@ apr_ssize_t;
278 typedef @off_t_value@ apr_off_t;
279 typedef @socklen_t_value@ apr_socklen_t;
281 typedef @ino_t_value@ apr_ino_t;
283 #define APR_SIZEOF_VOIDP @voidp_size@
285 /* Mechanisms to properly type numeric literals */
288 /* Definitions that APR programs need to work properly. */
291 * Thread callbacks from APR functions must be declared with APR_THREAD_FUNC,
292 * so that they follow the platform's calling convention.
295 /** void* APR_THREAD_FUNC my_thread_entry_fn(apr_thread_t *thd, void *data);
297 #define APR_THREAD_FUNC
300 * The public APR functions are declared with APR_DECLARE(), so they may
301 * use the most appropriate calling convention. Public APR functions with
302 * variable arguments must use APR_DECLARE_NONSTD().
304 * @remark Both the declaration and implementations must use the same macro.
307 /** APR_DECLARE(rettype) apr_func(args)
308 * @see APR_DECLARE_NONSTD @see APR_DECLARE_DATA
309 * @remark Note that when APR compiles the library itself, it passes the
310 * symbol -DAPR_DECLARE_EXPORT to the compiler on some platforms (e.g. Win32)
311 * to export public symbols from the dynamic library build.\n
312 * The user must define the APR_DECLARE_STATIC when compiling to target
313 * the static APR library on some platforms (e.g. Win32.) The public symbols
314 * are neither exported nor imported when APR_DECLARE_STATIC is defined.\n
315 * By default, compiling an application and including the APR public
316 * headers, without defining APR_DECLARE_STATIC, will prepare the code to be
317 * linked to the dynamic library.
319 #define APR_DECLARE(type) type
322 * The public APR functions using variable arguments are declared with
323 * APR_DECLARE_NONSTD(), as they must follow the C language calling convention.
324 * @see APR_DECLARE @see APR_DECLARE_DATA
325 * @remark Both the declaration and implementations must use the same macro.
328 /** APR_DECLARE_NONSTD(rettype) apr_func(args, ...);
330 #define APR_DECLARE_NONSTD(type) type
333 * The public APR variables are declared with AP_MODULE_DECLARE_DATA.
334 * This assures the appropriate indirection is invoked at compile time.
335 * @see APR_DECLARE @see APR_DECLARE_NONSTD
336 * @remark Note that the declaration and implementations use different forms,
337 * but both must include the macro.
340 /** extern APR_DECLARE_DATA type apr_variable;\n
341 * APR_DECLARE_DATA type apr_variable = value;
343 #define APR_DECLARE_DATA
345 /* Define APR_SSIZE_T_FMT.
346 * If ssize_t is an integer we define it to be "d",
347 * if ssize_t is a long int we define it to be "ld",
348 * if ssize_t is neither we declare an error here.
349 * I looked for a better way to define this here, but couldn't find one, so
350 * to find the logic for this definition search for "ssize_t_fmt" in
355 /* And APR_SIZE_T_FMT */
358 /* And APR_OFF_T_FMT */
361 /* And APR_PID_T_FMT */
364 /* And APR_INT64_T_FMT */
368 /* And APR_UINT64_T_FMT */
372 /* And APR_UINT64_T_HEX_FMT */
374 #define APR_UINT64_T_HEX_FMT_LEN (sizeof(APR_UINT64_T_HEX_FMT) - 1)
376 /* Deal with atoi64 variables ... these should move to apr_private.h */
377 #define APR_HAVE_INT64_STRFN @have_int64_strfn@
378 #define APR_INT64_STRFN @int64_strfn@
380 /* are we going to force the generic atomic operations */
381 #define APR_FORCE_ATOMIC_GENERIC @apr_force_atomic_generic@
383 /* Does the proc mutex lock threads too */
384 #define APR_PROC_MUTEX_IS_GLOBAL @proc_mutex_is_global@
386 /* Local machine definition for console and log output. */
387 #define APR_EOL_STR "@eolstr@"
390 #if APR_HAVE_SYS_WAIT_H
392 #define apr_wait_t int
394 #define apr_wait_t union wait
395 #define WEXITSTATUS(status) (int)((status).w_retcode)
396 #define WTERMSIG(status) (int)((status).w_termsig)
397 #endif /* !WEXITSTATUS */
398 #endif /* HAVE_SYS_WAIT_H */
400 #if defined(PATH_MAX)
401 #define APR_PATH_MAX PATH_MAX
402 #elif defined(_POSIX_PATH_MAX)
403 #define APR_PATH_MAX _POSIX_PATH_MAX
405 #error no decision has been made on APR_PATH_MAX for your platform