blob: f474d60f29d95aced36f60b9c51e88e0851dfa43 [file] [log] [blame]
Benny Prijonoa9b372a2006-07-24 02:07:11 +00001/* $Id$ */
2/*
Benny Prijono844653c2008-12-23 17:27:53 +00003 * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
4 * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
Benny Prijonoa9b372a2006-07-24 02:07:11 +00005 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20#ifndef __PJ_COMPAT_OS_AUTO_H__
21#define __PJ_COMPAT_OS_AUTO_H__
22
23/**
24 * @file os_auto.h
25 * @brief Describes operating system specifics (automatically detected by
26 * autoconf)
27 */
28
29/* Canonical OS name */
30#undef PJ_OS_NAME
31
Benny Prijonoc5b6dbf2006-09-10 16:33:48 +000032/* Legacy macros */
33#undef PJ_WIN32
34#undef PJ_WIN32_WINNT
35#undef WIN32_LEAN_AND_MEAN
36#undef PJ_DARWINOS
37#undef PJ_LINUX
38#undef PJ_RTEMS
39#undef PJ_SUNOS
40
41#if defined(PJ_WIN32_WINNT) && !defined(_WIN32_WINNT)
42# define _WIN32_WINNT PJ_WIN32_WINNT
43#endif
44
Benny Prijonoa9b372a2006-07-24 02:07:11 +000045/* Headers availability */
46#undef PJ_HAS_ARPA_INET_H
47#undef PJ_HAS_ASSERT_H
48#undef PJ_HAS_CTYPE_H
49#undef PJ_HAS_ERRNO_H
Benny Prijono1d481ab2008-01-24 15:27:30 +000050#undef PJ_HAS_FCNTL_H
Benny Prijonoa9b372a2006-07-24 02:07:11 +000051#undef PJ_HAS_LINUX_SOCKET_H
52#undef PJ_HAS_MALLOC_H
53#undef PJ_HAS_NETDB_H
Benny Prijono37fc9de2008-08-04 14:45:02 +000054#undef PJ_HAS_NETINET_IN_SYSTM_H
Benny Prijonoa9b372a2006-07-24 02:07:11 +000055#undef PJ_HAS_NETINET_IN_H
Benny Prijono87a00892007-02-01 00:33:12 +000056#undef PJ_HAS_NETINET_IP_H
Benny Prijono1d61ba52009-10-24 00:00:40 +000057#undef PJ_HAS_NETINET_TCP_H
Benny Prijono0ae59ae2007-11-17 10:27:34 +000058#undef PJ_HAS_NET_IF_H
Benny Prijono1d65f702007-12-03 04:03:17 +000059#undef PJ_HAS_IFADDRS_H
Benny Prijono1c5f4e42008-02-07 13:11:39 +000060#undef PJ_HAS_SEMAPHORE_H
Benny Prijonoa9b372a2006-07-24 02:07:11 +000061#undef PJ_HAS_SETJMP_H
62#undef PJ_HAS_STDARG_H
63#undef PJ_HAS_STDDEF_H
64#undef PJ_HAS_STDIO_H
Benny Prijonofdafd402008-01-23 14:34:46 +000065#undef PJ_HAS_STDINT_H
Benny Prijonoa9b372a2006-07-24 02:07:11 +000066#undef PJ_HAS_STDLIB_H
67#undef PJ_HAS_STRING_H
68#undef PJ_HAS_SYS_IOCTL_H
69#undef PJ_HAS_SYS_SELECT_H
70#undef PJ_HAS_SYS_SOCKET_H
71#undef PJ_HAS_SYS_TIME_H
72#undef PJ_HAS_SYS_TIMEB_H
73#undef PJ_HAS_SYS_TYPES_H
74#undef PJ_HAS_TIME_H
75#undef PJ_HAS_UNISTD_H
76
77#undef PJ_HAS_MSWSOCK_H
78#undef PJ_HAS_WINSOCK_H
79#undef PJ_HAS_WINSOCK2_H
Benny Prijonoe2746132008-09-27 13:16:35 +000080#undef PJ_HAS_WS2TCPIP_H
Benny Prijonoa9b372a2006-07-24 02:07:11 +000081
82#undef PJ_SOCK_HAS_INET_ATON
Benny Prijonoc16c6e32007-11-18 14:53:47 +000083#undef PJ_SOCK_HAS_INET_PTON
84#undef PJ_SOCK_HAS_INET_NTOP
85#undef PJ_SOCK_HAS_GETADDRINFO
Benny Prijonoa9b372a2006-07-24 02:07:11 +000086
Benny Prijono1c5f4e42008-02-07 13:11:39 +000087/* On these OSes, semaphore feature depends on semaphore.h */
88#if defined(PJ_HAS_SEMAPHORE_H) && PJ_HAS_SEMAPHORE_H!=0
89# define PJ_HAS_SEMAPHORE 1
Benny Prijonoc2e34812008-02-08 15:18:20 +000090#elif defined(PJ_WIN32) && PJ_WIN32!=0
91# define PJ_HAS_SEMAPHORE 1
Benny Prijono1c5f4e42008-02-07 13:11:39 +000092#else
93# define PJ_HAS_SEMAPHORE 0
94#endif
95
96/* Do we have pthread_mutexattr_settype()? */
97#undef PJ_HAS_PTHREAD_MUTEXATTR_SETTYPE
98
99/* Does pthread_mutexattr_t has "recursive" member? */
100#undef PJ_PTHREAD_MUTEXATTR_T_HAS_RECURSIVE
101
Benny Prijonoa9b372a2006-07-24 02:07:11 +0000102/* Set 1 if native sockaddr_in has sin_len member.
103 * Default: 0
104 */
105#undef PJ_SOCKADDR_HAS_LEN
106
Benny Prijono30f85c62006-09-09 20:05:33 +0000107/* Does the OS have socklen_t? */
108#undef PJ_HAS_SOCKLEN_T
109
Benny Prijonob726d262008-07-19 18:05:04 +0000110#if !defined(socklen_t) && (!defined(PJ_HAS_SOCKLEN_T) || PJ_HAS_SOCKLEN_T==0)
Benny Prijonoc5b6dbf2006-09-10 16:33:48 +0000111# define PJ_HAS_SOCKLEN_T 1
Benny Prijono30f85c62006-09-09 20:05:33 +0000112 typedef int socklen_t;
113#endif
114
Benny Prijonoa9b372a2006-07-24 02:07:11 +0000115/**
116 * If this macro is set, it tells select I/O Queue that select() needs to
117 * be given correct value of nfds (i.e. largest fd + 1). This requires
118 * select ioqueue to re-scan the descriptors on each registration and
119 * unregistration.
120 * If this macro is not set, then ioqueue will always give FD_SETSIZE for
121 * nfds argument when calling select().
122 *
123 * Default: 0
124 */
125#undef PJ_SELECT_NEEDS_NFDS
126
127/* Is errno a good way to retrieve OS errors?
128 */
129#undef PJ_HAS_ERRNO_VAR
130
131/* When this macro is set, getsockopt(SOL_SOCKET, SO_ERROR) will return
132 * the status of non-blocking connect() operation.
133 */
134#undef PJ_HAS_SO_ERROR
135
136/* This value specifies the value set in errno by the OS when a non-blocking
137 * socket recv() can not return immediate daata.
138 */
139#undef PJ_BLOCKING_ERROR_VAL
140
141/* This value specifies the value set in errno by the OS when a non-blocking
142 * socket connect() can not get connected immediately.
143 */
144#undef PJ_BLOCKING_CONNECT_ERROR_VAL
145
146/* Default threading is enabled, unless it's overridden. */
147#ifndef PJ_HAS_THREADS
148# define PJ_HAS_THREADS (1)
149#endif
150
Benny Prijono30f85c62006-09-09 20:05:33 +0000151/* Do we need high resolution timer? */
Benny Prijonoa9b372a2006-07-24 02:07:11 +0000152#undef PJ_HAS_HIGH_RES_TIMER
Benny Prijono30f85c62006-09-09 20:05:33 +0000153
154/* Is malloc() available? */
Benny Prijonoa9b372a2006-07-24 02:07:11 +0000155#undef PJ_HAS_MALLOC
Benny Prijono30f85c62006-09-09 20:05:33 +0000156
Benny Prijonoa9b372a2006-07-24 02:07:11 +0000157#ifndef PJ_OS_HAS_CHECK_STACK
158# define PJ_OS_HAS_CHECK_STACK 0
159#endif
Benny Prijono30f85c62006-09-09 20:05:33 +0000160
161/* Unicode? */
Benny Prijonoa9b372a2006-07-24 02:07:11 +0000162#undef PJ_NATIVE_STRING_IS_UNICODE
163
Benny Prijono1d971622006-09-10 22:27:40 +0000164/* Pool alignment in bytes */
165#undef PJ_POOL_ALIGNMENT
166
Benny Prijono30f85c62006-09-09 20:05:33 +0000167/* The type of atomic variable value: */
Benny Prijonoa9b372a2006-07-24 02:07:11 +0000168#undef PJ_ATOMIC_VALUE_TYPE
169
170/* If 1, use Read/Write mutex emulation for platforms that don't support it */
171#undef PJ_EMULATE_RWMUTEX
172
173/* If 1, pj_thread_create() should enforce the stack size when creating
174 * threads.
175 * Default: 0 (let OS decide the thread's stack size).
176 */
177#undef PJ_THREAD_SET_STACK_SIZE
178
179/* If 1, pj_thread_create() should allocate stack from the pool supplied.
180 * Default: 0 (let OS allocate memory for thread's stack).
181 */
182#undef PJ_THREAD_ALLOCATE_STACK
183
Nanang Izzuddinea6d3c42009-10-26 15:47:52 +0000184/* SSL socket availability. */
185#ifndef PJ_HAS_SSL_SOCK
186#undef PJ_HAS_SSL_SOCK
187#endif
188
189
Benny Prijonoa9b372a2006-07-24 02:07:11 +0000190#endif /* __PJ_COMPAT_OS_AUTO_H__ */
191