Debian Codegraph @

Xpjproject/pjlib/include/pj/compat/os_auto.h.in

raw
1 /*
2 * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
3 * Copyright (C) 2003-2008 Benny Prijono <[email protected]>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */
19 #ifndef __PJ_COMPAT_OS_AUTO_H__
20 #define __PJ_COMPAT_OS_AUTO_H__
21
22 /**
23 * @file os_auto.h
24 * @brief Describes operating system specifics (automatically detected by
25 * autoconf)
26 */
27
28 /* Canonical OS name */
29 #undef PJ_OS_NAME
30
31 /* Legacy macros */
32 #undef PJ_WIN64
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_BSD
39 #undef PJ_RTEMS
40 #undef PJ_SUNOS
41 #undef PJ_ANDROID
42
43 #if defined(PJ_WIN32_WINNT) && !defined(_WIN32_WINNT)
44 # define _WIN32_WINNT PJ_WIN32_WINNT
45 #endif
46
47 /* Headers availability */
48 #undef PJ_HAS_ARPA_INET_H
49 #undef PJ_HAS_ASSERT_H
50 #undef PJ_HAS_CTYPE_H
51 #undef PJ_HAS_ERRNO_H
52 #undef PJ_HAS_FCNTL_H
53 #undef PJ_HAS_LIMITS_H
54 #undef PJ_HAS_LINUX_SOCKET_H
55 #undef PJ_HAS_MALLOC_H
56 #undef PJ_HAS_NETDB_H
57 #undef PJ_HAS_NETINET_IN_SYSTM_H
58 #undef PJ_HAS_NETINET_IN_H
59 #undef PJ_HAS_NETINET_IP_H
60 #undef PJ_HAS_NETINET_TCP_H
61 #undef PJ_HAS_NET_IF_H
62 #undef PJ_HAS_IFADDRS_H
63 #undef PJ_HAS_INTTYPES_H
64 #undef PJ_HAS_SEMAPHORE_H
65 #undef PJ_HAS_SETJMP_H
66 #undef PJ_HAS_STDARG_H
67 #undef PJ_HAS_STDDEF_H
68 #undef PJ_HAS_STDIO_H
69 #undef PJ_HAS_STDINT_H
70 #undef PJ_HAS_STDLIB_H
71 #undef PJ_HAS_STRING_H
72 #undef PJ_HAS_SYS_IOCTL_H
73 #undef PJ_HAS_SYS_SELECT_H
74 #undef PJ_HAS_SYS_SOCKET_H
75 #undef PJ_HAS_SYS_TIME_H
76 #undef PJ_HAS_SYS_TIMEB_H
77 #undef PJ_HAS_SYS_TYPES_H
78 #undef PJ_HAS_SYS_FILIO_H
79 #undef PJ_HAS_SYS_SOCKIO_H
80 #undef PJ_HAS_SYS_UTSNAME_H
81 #undef PJ_HAS_TIME_H
82 #undef PJ_HAS_UNISTD_H
83 #undef PJ_HAS_EXECINFO_H
84
85 #undef PJ_HAS_MSWSOCK_H
86 #undef PJ_HAS_WINSOCK_H
87 #undef PJ_HAS_WINSOCK2_H
88 #undef PJ_HAS_WS2TCPIP_H
89
90 #undef PJ_SOCK_HAS_IPV6_V6ONLY
91 #undef PJ_SOCK_HAS_INET_ATON
92 #undef PJ_SOCK_HAS_INET_PTON
93 #undef PJ_SOCK_HAS_INET_NTOP
94 #undef PJ_SOCK_HAS_GETADDRINFO
95 #undef PJ_SOCK_HAS_SOCKETPAIR
96
97 /* On these OSes, semaphore feature depends on semaphore.h */
98 #if defined(PJ_HAS_SEMAPHORE_H) && PJ_HAS_SEMAPHORE_H!=0
99 # define PJ_HAS_SEMAPHORE 1
100 #elif defined(PJ_WIN32) && PJ_WIN32!=0
101 # define PJ_HAS_SEMAPHORE 1
102 #else
103 # define PJ_HAS_SEMAPHORE 0
104 #endif
105
106 /* Do we have pthread_mutexattr_settype()? */
107 #undef PJ_HAS_PTHREAD_MUTEXATTR_SETTYPE
108
109 /* Does pthread_mutexattr_t has "recursive" member? */
110 #undef PJ_PTHREAD_MUTEXATTR_T_HAS_RECURSIVE
111
112 /* Set 1 if native sockaddr_in has sin_len member.
113 * Default: 0
114 */
115 #undef PJ_SOCKADDR_HAS_LEN
116
117 /* Does the OS have socklen_t? */
118 #undef PJ_HAS_SOCKLEN_T
119
120 #if !defined(socklen_t) && (!defined(PJ_HAS_SOCKLEN_T) || PJ_HAS_SOCKLEN_T==0)
121 # define PJ_HAS_SOCKLEN_T 1
122 typedef int socklen_t;
123 #endif
124
125 /* Select I/O queue backend. */
126 #undef PJ_IOQUEUE_IMP
127
128 /**
129 * If this macro is set, it tells select I/O Queue that select() needs to
130 * be given correct value of nfds (i.e. largest fd + 1). This requires
131 * select ioqueue to re-scan the descriptors on each registration and
132 * unregistration.
133 * If this macro is not set, then ioqueue will always give FD_SETSIZE for
134 * nfds argument when calling select().
135 *
136 * Default: 0
137 */
138 #undef PJ_SELECT_NEEDS_NFDS
139
140 /* Is errno a good way to retrieve OS errors?
141 */
142 #undef PJ_HAS_ERRNO_VAR
143
144 /* When this macro is set, getsockopt(SOL_SOCKET, SO_ERROR) will return
145 * the status of non-blocking connect() operation.
146 */
147 #undef PJ_HAS_SO_ERROR
148
149 /* This value specifies the value set in errno by the OS when a non-blocking
150 * socket recv() can not return immediate daata.
151 */
152 #undef PJ_BLOCKING_ERROR_VAL
153
154 /* This value specifies the value set in errno by the OS when a non-blocking
155 * socket connect() can not get connected immediately.
156 */
157 #undef PJ_BLOCKING_CONNECT_ERROR_VAL
158
159 /* Default threading is enabled, unless it's overridden. */
160 #ifndef PJ_HAS_THREADS
161 # define PJ_HAS_THREADS (1)
162 #endif
163
164 /* Do we need high resolution timer? */
165 #undef PJ_HAS_HIGH_RES_TIMER
166
167 /* Is malloc() available? */
168 #undef PJ_HAS_MALLOC
169
170 #ifndef PJ_OS_HAS_CHECK_STACK
171 # define PJ_OS_HAS_CHECK_STACK 0
172 #endif
173
174 /* Is localtime_r() available? */
175 #undef PJ_HAS_LOCALTIME_R
176
177 /* Unicode? */
178 #undef PJ_NATIVE_STRING_IS_UNICODE
179
180 /* Pool alignment in bytes */
181 #undef PJ_POOL_ALIGNMENT
182
183 /* The type of atomic variable value: */
184 #undef PJ_ATOMIC_VALUE_TYPE
185
186 #if defined(PJ_DARWINOS) && PJ_DARWINOS!=0
187 /* Disable local host resolution in pj_gethostip() (see ticket #1342) */
188 # define PJ_GETHOSTIP_DISABLE_LOCAL_RESOLUTION 1
189 /* Use pj_getaddrinfo() (instead of pj_inet_pton()) in
190 * pj_sockaddr_set_str_addr()
191 */
192 # define PJ_SOCKADDR_USE_GETADDRINFO 1
193
194 # include "TargetConditionals.h"
195 # if TARGET_OS_IPHONE
196 # include "Availability.h"
197 /* Use CFHost API for pj_getaddrinfo() (see ticket #1246) */
198 # ifndef PJ_GETADDRINFO_USE_CFHOST
199 # define PJ_GETADDRINFO_USE_CFHOST 0
200 # endif
201 # ifdef __IPHONE_4_0
202 /* Is multitasking support available? (see ticket #1107) */
203 # define PJ_IPHONE_OS_HAS_MULTITASKING_SUPPORT 1
204 /* Activesock TCP background mode support (VoIP socket).
205 * Disabled by default, VoIP socket deprecated since iOS 9 and
206 * on iOS16 using VoIP socket causes app getting killed.
207 */
208 # define PJ_ACTIVESOCK_TCP_IPHONE_OS_BG 0
209 # endif
210 # endif
211 #endif
212
213 /* If 1, use Read/Write mutex emulation for platforms that don't support it */
214 #undef PJ_EMULATE_RWMUTEX
215
216 /* If 1, pj_thread_create() should enforce the stack size when creating
217 * threads.
218 * Default: 0 (let OS decide the thread's stack size).
219 */
220 #undef PJ_THREAD_SET_STACK_SIZE
221
222 /* If 1, pj_thread_create() should allocate stack from the pool supplied.
223 * Default: 0 (let OS allocate memory for thread's stack).
224 */
225 #undef PJ_THREAD_ALLOCATE_STACK
226
227 /* SSL socket availability. */
228 #ifndef PJ_HAS_SSL_SOCK
229 #undef PJ_HAS_SSL_SOCK
230 #endif
231 #ifndef PJ_SSL_SOCK_IMP
232 #undef PJ_SSL_SOCK_IMP
233 #endif
234
235 /* Has pthread_np.h ? */
236 #undef PJ_HAS_PTHREAD_NP_H
237 /* Has pthread_setname_np() ? */
238 #undef PJ_HAS_PTHREAD_SETNAME_NP
239 /* Has pthread_set_name_np() ? */
240 #undef PJ_HAS_PTHREAD_SET_NAME_NP
241
242
243 #endif /* __PJ_COMPAT_OS_AUTO_H__ */
244