Debian Codegraph @

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

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 #cmakedefine PJ_OS_NAME "@PJ_OS_NAME@"
30
31 /* Legacy macros */
32 #cmakedefine PJ_WIN64 @PJ_WIN64@
33 #cmakedefine PJ_WIN32 @PJ_WIN32@
34 #cmakedefine PJ_WIN32_WINNT @PJ_WIN32_WINNT@
35 #cmakedefine WIN32_LEAN_AND_MEAN @WIN32_LEAN_AND_MEAN@
36 #cmakedefine PJ_DARWINOS @PJ_DARWINOS@
37 #cmakedefine PJ_LINUX @PJ_LINUX@
38 #cmakedefine PJ_BSD @PJ_BSD@
39 #cmakedefine PJ_RTEMS @PJ_RTEMS@
40 #cmakedefine PJ_SUNOS @PJ_SUNOS@
41 #cmakedefine PJ_ANDROID @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 #cmakedefine01 PJ_HAS_ARPA_INET_H
49 #cmakedefine01 PJ_HAS_ASSERT_H
50 #cmakedefine01 PJ_HAS_CTYPE_H
51 #cmakedefine01 PJ_HAS_ERRNO_H
52 #cmakedefine01 PJ_HAS_FCNTL_H
53 #cmakedefine01 PJ_HAS_LIMITS_H
54 #cmakedefine01 PJ_HAS_LINUX_SOCKET_H
55 #cmakedefine01 PJ_HAS_MALLOC_H
56 #cmakedefine01 PJ_HAS_NETDB_H
57 #cmakedefine01 PJ_HAS_NETINET_IN_SYSTM_H
58 #cmakedefine01 PJ_HAS_NETINET_IN_H
59 #cmakedefine01 PJ_HAS_NETINET_IP_H
60 #cmakedefine01 PJ_HAS_NETINET_TCP_H
61 #cmakedefine01 PJ_HAS_NET_IF_H
62 #cmakedefine01 PJ_HAS_IFADDRS_H
63 #cmakedefine01 PJ_HAS_INTTYPES_H
64 #cmakedefine01 PJ_HAS_SEMAPHORE_H
65 #cmakedefine01 PJ_HAS_SETJMP_H
66 #cmakedefine01 PJ_HAS_STDARG_H
67 #cmakedefine01 PJ_HAS_STDDEF_H
68 #cmakedefine01 PJ_HAS_STDIO_H
69 #cmakedefine01 PJ_HAS_STDINT_H
70 #cmakedefine01 PJ_HAS_STDLIB_H
71 #cmakedefine01 PJ_HAS_STRING_H
72 #cmakedefine01 PJ_HAS_SYS_IOCTL_H
73 #cmakedefine01 PJ_HAS_SYS_SELECT_H
74 #cmakedefine01 PJ_HAS_SYS_SOCKET_H
75 #cmakedefine01 PJ_HAS_SYS_TIME_H
76 #cmakedefine01 PJ_HAS_SYS_TIMEB_H
77 #cmakedefine01 PJ_HAS_SYS_TYPES_H
78 #cmakedefine01 PJ_HAS_SYS_FILIO_H
79 #cmakedefine01 PJ_HAS_SYS_SOCKIO_H
80 #cmakedefine01 PJ_HAS_SYS_UTSNAME_H
81 #cmakedefine01 PJ_HAS_TIME_H
82 #cmakedefine01 PJ_HAS_UNISTD_H
83 #cmakedefine01 PJ_HAS_EXECINFO_H
84
85 #cmakedefine01 PJ_HAS_MSWSOCK_H
86 #cmakedefine01 PJ_HAS_WINSOCK_H
87 #cmakedefine01 PJ_HAS_WINSOCK2_H
88 #cmakedefine01 PJ_HAS_WS2TCPIP_H
89
90 #cmakedefine01 PJ_SOCK_HAS_IPV6_V6ONLY
91 #cmakedefine01 PJ_SOCK_HAS_INET_ATON
92 #cmakedefine01 PJ_SOCK_HAS_INET_PTON
93 #cmakedefine01 PJ_SOCK_HAS_INET_NTOP
94 #cmakedefine01 PJ_SOCK_HAS_GETADDRINFO
95 #cmakedefine01 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 #cmakedefine01 PJ_HAS_PTHREAD_MUTEXATTR_SETTYPE
108
109 /* Does pthread_mutexattr_t has "recursive" member? */
110 #cmakedefine01 PJ_PTHREAD_MUTEXATTR_T_HAS_RECURSIVE
111
112 /* Set 1 if native sockaddr_in has sin_len member.
113 * Default: 0
114 */
115 #cmakedefine01 PJ_SOCKADDR_HAS_LEN
116
117 /* Does the OS have socklen_t? */
118 #cmakedefine01 PJ_HAS_SOCKLEN_T
119
120 #if !defined(socklen_t) && (!defined(PJ_HAS_SOCKLEN_T) || PJ_HAS_SOCKLEN_T==0)
121 # undef PJ_HAS_SOCKLEN_T
122 # define PJ_HAS_SOCKLEN_T 1
123 typedef int socklen_t;
124 #endif
125
126 /* Select I/O queue backend. */
127 #cmakedefine PJ_IOQUEUE_IMP @PJ_IOQUEUE_IMP@
128
129 /**
130 * If this macro is set, it tells select I/O Queue that select() needs to
131 * be given correct value of nfds (i.e. largest fd + 1). This requires
132 * select ioqueue to re-scan the descriptors on each registration and
133 * unregistration.
134 * If this macro is not set, then ioqueue will always give FD_SETSIZE for
135 * nfds argument when calling select().
136 *
137 * Default: 0
138 */
139 #cmakedefine01 PJ_SELECT_NEEDS_NFDS
140
141 /* Is errno a good way to retrieve OS errors?
142 */
143 #cmakedefine01 PJ_HAS_ERRNO_VAR
144
145 /* When this macro is set, getsockopt(SOL_SOCKET, SO_ERROR) will return
146 * the status of non-blocking connect() operation.
147 */
148 #cmakedefine01 PJ_HAS_SO_ERROR
149
150 /* This value specifies the value set in errno by the OS when a non-blocking
151 * socket recv() can not return immediate daata.
152 */
153 #cmakedefine PJ_BLOCKING_ERROR_VAL @PJ_BLOCKING_ERROR_VAL@
154
155 /* This value specifies the value set in errno by the OS when a non-blocking
156 * socket connect() can not get connected immediately.
157 */
158 #cmakedefine PJ_BLOCKING_CONNECT_ERROR_VAL @PJ_BLOCKING_CONNECT_ERROR_VAL@
159
160 /* Default threading is enabled, unless it's overridden. */
161 #ifndef PJ_HAS_THREADS
162 # define PJ_HAS_THREADS (1)
163 #endif
164
165 /* Do we need high resolution timer? */
166 #cmakedefine01 PJ_HAS_HIGH_RES_TIMER
167
168 /* Is malloc() available? */
169 #cmakedefine01 PJ_HAS_MALLOC
170
171 #ifndef PJ_OS_HAS_CHECK_STACK
172 # define PJ_OS_HAS_CHECK_STACK 0
173 #endif
174
175 /* Is localtime_r() available? */
176 #cmakedefine01 PJ_HAS_LOCALTIME_R
177
178 /* Unicode? */
179 #cmakedefine01 PJ_NATIVE_STRING_IS_UNICODE
180
181 /* Pool alignment in bytes */
182 #cmakedefine PJ_POOL_ALIGNMENT @PJ_POOL_ALIGNMENT@
183
184 /* The type of atomic variable value: */
185 #cmakedefine PJ_ATOMIC_VALUE_TYPE @PJ_ATOMIC_VALUE_TYPE@
186
187 #if defined(PJ_DARWINOS) && PJ_DARWINOS!=0
188 /* Disable local host resolution in pj_gethostip() (see ticket #1342) */
189 # define PJ_GETHOSTIP_DISABLE_LOCAL_RESOLUTION 1
190 /* Use pj_getaddrinfo() (instead of pj_inet_pton()) in
191 * pj_sockaddr_set_str_addr()
192 */
193 # define PJ_SOCKADDR_USE_GETADDRINFO 1
194
195 # include "TargetConditionals.h"
196 # if TARGET_OS_IPHONE
197 # include "Availability.h"
198 /* Use CFHost API for pj_getaddrinfo() (see ticket #1246) */
199 # ifndef PJ_GETADDRINFO_USE_CFHOST
200 # define PJ_GETADDRINFO_USE_CFHOST 0
201 # endif
202 # ifdef __IPHONE_4_0
203 /* Is multitasking support available? (see ticket #1107) */
204 # define PJ_IPHONE_OS_HAS_MULTITASKING_SUPPORT 1
205 /* Activesock TCP background mode support (VoIP socket).
206 * Disabled by default, VoIP socket deprecated since iOS 9 and
207 * on iOS16 using VoIP socket causes app getting killed.
208 */
209 # define PJ_ACTIVESOCK_TCP_IPHONE_OS_BG 0
210 # endif
211 # endif
212 #endif
213
214 /* If 1, use Read/Write mutex emulation for platforms that don't support it */
215 #cmakedefine01 PJ_EMULATE_RWMUTEX
216
217 /* If 1, pj_thread_create() should enforce the stack size when creating
218 * threads.
219 * Default: 0 (let OS decide the thread's stack size).
220 */
221 #cmakedefine01 PJ_THREAD_SET_STACK_SIZE
222
223 /* If 1, pj_thread_create() should allocate stack from the pool supplied.
224 * Default: 0 (let OS allocate memory for thread's stack).
225 */
226 #cmakedefine01 PJ_THREAD_ALLOCATE_STACK
227
228 /* SSL socket availability. */
229 #ifndef PJ_HAS_SSL_SOCK
230 #cmakedefine01 PJ_HAS_SSL_SOCK
231 #endif
232 #ifndef PJ_SSL_SOCK_IMP
233 #cmakedefine PJ_SSL_SOCK_IMP @PJ_SSL_SOCK_IMP@
234 #endif
235
236 /* Has pthread_np.h ? */
237 #cmakedefine01 PJ_HAS_PTHREAD_NP_H
238 /* Has pthread_setname_np() ? */
239 #cmakedefine01 PJ_HAS_PTHREAD_SETNAME_NP
240 /* Has pthread_set_name_np() ? */
241 #cmakedefine01 PJ_HAS_PTHREAD_SET_NAME_NP
242
243 #cmakedefine NOMINMAX @NOMINMAX@
244
245
246 #endif /* __PJ_COMPAT_OS_AUTO_H__ */