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 1
73 #define APR_HAVE_CONIO_H 0
74 #define APR_HAVE_CRYPT_H 1
75 #define APR_HAVE_CTYPE_H 1
76 #define APR_HAVE_DIRENT_H 1
77 #define APR_HAVE_ERRNO_H 1
78 #define APR_HAVE_FCNTL_H 1
79 #define APR_HAVE_IO_H 0
80 #define APR_HAVE_LIMITS_H 1
81 #define APR_HAVE_NETDB_H 1
82 #define APR_HAVE_NETINET_IN_H 1
83 #define APR_HAVE_NETINET_SCTP_H 0
84 #define APR_HAVE_NETINET_SCTP_UIO_H 0
85 #define APR_HAVE_NETINET_TCP_H 1
86 #define APR_HAVE_PTHREAD_H 1
87 #define APR_HAVE_SEMAPHORE_H 1
88 #define APR_HAVE_SIGNAL_H 1
89 #define APR_HAVE_STDARG_H 1
90 #define APR_HAVE_STDINT_H 1
91 #define APR_HAVE_STDIO_H 1
92 #define APR_HAVE_STDLIB_H 1
93 #define APR_HAVE_STRING_H 1
94 #define APR_HAVE_STRINGS_H 1
95 #define APR_HAVE_SYS_IOCTL_H 1
96 #define APR_HAVE_SYS_SENDFILE_H 1
97 #define APR_HAVE_SYS_SIGNAL_H 1
98 #define APR_HAVE_SYS_SOCKET_H 1
99 #define APR_HAVE_SYS_SOCKIO_H 0
100 #define APR_HAVE_SYS_SYSLIMITS_H 0
101 #define APR_HAVE_SYS_TIME_H 1
102 #define APR_HAVE_SYS_TYPES_H 1
103 #define APR_HAVE_SYS_UIO_H 1
104 #define APR_HAVE_SYS_UN_H 1
105 #define APR_HAVE_SYS_WAIT_H 1
106 #define APR_HAVE_TIME_H 1
107 #define APR_HAVE_UNISTD_H 1
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 1
164 #define APR_HAVE_SHMEM_MMAP_SHM 1
165 #define APR_HAVE_SHMEM_MMAP_ZERO 1
166 #define APR_HAVE_SHMEM_SHMGET_ANON 1
167 #define APR_HAVE_SHMEM_SHMGET 1
168 #define APR_HAVE_SHMEM_MMAP_ANON 1
169 #define APR_HAVE_SHMEM_BEOS 0
171 #define APR_USE_SHMEM_MMAP_TMP 0
172 #define APR_USE_SHMEM_MMAP_SHM 0
173 #define APR_USE_SHMEM_MMAP_ZERO 0
174 #define APR_USE_SHMEM_SHMGET_ANON 0
175 #define APR_USE_SHMEM_SHMGET 1
176 #define APR_USE_SHMEM_MMAP_ANON 1
177 #define APR_USE_SHMEM_BEOS 0
179 #define APR_USE_FLOCK_SERIALIZE 0
180 #define APR_USE_SYSVSEM_SERIALIZE 1
181 #define APR_USE_POSIXSEM_SERIALIZE 0
182 #define APR_USE_FCNTL_SERIALIZE 0
183 #define APR_USE_PROC_PTHREAD_SERIALIZE 0
184 #define APR_USE_PTHREAD_SERIALIZE 1
186 #define APR_HAS_FLOCK_SERIALIZE 1
187 #define APR_HAS_SYSVSEM_SERIALIZE 1
188 #define APR_HAS_POSIXSEM_SERIALIZE 0
189 #define APR_HAS_FCNTL_SERIALIZE 1
190 #define APR_HAS_PROC_PTHREAD_SERIALIZE 1
191 #define APR_HAS_RWLOCK_SERIALIZE 0
193 #define APR_PROCESS_LOCK_IS_GLOBAL 0
195 #define APR_HAVE_CORKABLE_TCP 1
196 #define APR_HAVE_GETRLIMIT 1
197 #define APR_HAVE_IN_ADDR 1
198 #define APR_HAVE_INET_ADDR 1
199 #define APR_HAVE_INET_NETWORK 1
200 #define APR_HAVE_IPV6 1
201 #define APR_HAVE_MEMMOVE 1
202 #define APR_HAVE_SETRLIMIT 1
203 #define APR_HAVE_SIGACTION 1
204 #define APR_HAVE_SIGSUSPEND 1
205 #define APR_HAVE_SIGWAIT 1
206 #define APR_HAVE_STRCASECMP 1
207 #define APR_HAVE_STRDUP 1
208 #define APR_HAVE_STRICMP 0
209 #define APR_HAVE_STRNCASECMP 1
210 #define APR_HAVE_STRNICMP 0
211 #define APR_HAVE_STRSTR 1
212 #define APR_HAVE_MEMCHR 1
213 #define APR_HAVE_STRUCT_RLIMIT 1
214 #define APR_HAVE_UNION_SEMUN 0
215 #define APR_HAVE_SCTP 0
217 /* APR Feature Macros */
218 #define APR_HAS_SHARED_MEMORY 1
219 #define APR_HAS_THREADS 1
220 #define APR_HAS_SENDFILE 1
221 #define APR_HAS_MMAP 1
222 #define APR_HAS_FORK 1
223 #define APR_HAS_RANDOM 1
224 #define APR_HAS_OTHER_CHILD 1
225 #define APR_HAS_DSO 1
226 #define APR_HAS_SO_ACCEPTFILTER 0
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 1
241 /* Not all platforms have a real INADDR_NONE. This macro replaces INADDR_NONE
244 #define APR_INADDR_NONE INADDR_NONE
246 /* This macro indicates whether or not EBCDIC is the native character set.
248 #define APR_CHARSET_EBCDIC 0
250 /* If we have a TCP implementation that can be "corked", what flag
253 #define APR_TCP_NOPUSH_FLAG TCP_CORK
255 /* Is the TCP_NODELAY socket option inherited from listening sockets?
257 #define APR_TCP_NODELAY_INHERITED 1
259 /* Is the O_NONBLOCK flag inherited from listening sockets?
261 #define APR_O_NONBLOCK_INHERITED 0
263 /* Typedefs that APR needs. */
265 typedef unsigned char apr_byte_t;
267 typedef short apr_int16_t;
268 typedef unsigned short apr_uint16_t;
270 typedef int apr_int32_t;
271 typedef unsigned int apr_uint32_t;
273 typedef long apr_int64_t;
274 typedef unsigned long apr_uint64_t;
276 typedef size_t apr_size_t;
277 typedef ssize_t apr_ssize_t;
278 typedef off_t apr_off_t;
279 typedef socklen_t apr_socklen_t;
281 typedef unsigned long apr_ino_t;
283 #define APR_SIZEOF_VOIDP 8
285 /* Mechanisms to properly type numeric literals */
286 #define APR_INT64_C(val) INT64_C(val)
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
353 #define APR_SSIZE_T_FMT "ld"
355 /* And APR_SIZE_T_FMT */
356 #define APR_SIZE_T_FMT "ld"
358 /* And APR_OFF_T_FMT */
359 #define APR_OFF_T_FMT "ld"
361 /* And APR_PID_T_FMT */
362 #define APR_PID_T_FMT "d"
364 /* And APR_INT64_T_FMT */
365 #define APR_INT64_T_FMT "ld"
366 #define APR_INT64_T_FMT_LEN 2
368 /* And APR_UINT64_T_FMT */
369 #define APR_UINT64_T_FMT "lu"
370 #define APR_UINT64_T_FMT_LEN 2
372 /* And APR_UINT64_T_HEX_FMT */
373 #define APR_UINT64_T_HEX_FMT "lx"
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 1
378 #define APR_INT64_STRFN strtol
380 /* are we going to force the generic atomic operations */
381 #define APR_FORCE_ATOMIC_GENERIC 1
383 /* Does the proc mutex lock threads too */
384 #define APR_PROC_MUTEX_IS_GLOBAL 0
386 /* Local machine definition for console and log output. */
387 #define APR_EOL_STR "\n"
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