1
/* $Id: os_auto.h.in 3841 2011-10-24 09:28:13Z ming $ */
3
* Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
4
* Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
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.
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.
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
20
#ifndef __PJ_COMPAT_OS_AUTO_H__
21
#define __PJ_COMPAT_OS_AUTO_H__
25
* @brief Describes operating system specifics (automatically detected by
29
/* Canonical OS name */
35
#undef WIN32_LEAN_AND_MEAN
41
#if defined(PJ_WIN32_WINNT) && !defined(_WIN32_WINNT)
42
# define _WIN32_WINNT PJ_WIN32_WINNT
45
/* Headers availability */
46
#undef PJ_HAS_ARPA_INET_H
47
#undef PJ_HAS_ASSERT_H
51
#undef PJ_HAS_LIMITS_H
52
#undef PJ_HAS_LINUX_SOCKET_H
53
#undef PJ_HAS_MALLOC_H
55
#undef PJ_HAS_NETINET_IN_SYSTM_H
56
#undef PJ_HAS_NETINET_IN_H
57
#undef PJ_HAS_NETINET_IP_H
58
#undef PJ_HAS_NETINET_TCP_H
59
#undef PJ_HAS_NET_IF_H
60
#undef PJ_HAS_IFADDRS_H
61
#undef PJ_HAS_SEMAPHORE_H
62
#undef PJ_HAS_SETJMP_H
63
#undef PJ_HAS_STDARG_H
64
#undef PJ_HAS_STDDEF_H
66
#undef PJ_HAS_STDINT_H
67
#undef PJ_HAS_STDLIB_H
68
#undef PJ_HAS_STRING_H
69
#undef PJ_HAS_SYS_IOCTL_H
70
#undef PJ_HAS_SYS_SELECT_H
71
#undef PJ_HAS_SYS_SOCKET_H
72
#undef PJ_HAS_SYS_TIME_H
73
#undef PJ_HAS_SYS_TIMEB_H
74
#undef PJ_HAS_SYS_TYPES_H
75
#undef PJ_HAS_SYS_FILIO_H
76
#undef PJ_HAS_SYS_SOCKIO_H
77
#undef PJ_HAS_SYS_UTSNAME_H
79
#undef PJ_HAS_UNISTD_H
81
#undef PJ_HAS_MSWSOCK_H
82
#undef PJ_HAS_WINSOCK_H
83
#undef PJ_HAS_WINSOCK2_H
84
#undef PJ_HAS_WS2TCPIP_H
86
#undef PJ_SOCK_HAS_INET_ATON
87
#undef PJ_SOCK_HAS_INET_PTON
88
#undef PJ_SOCK_HAS_INET_NTOP
89
#undef PJ_SOCK_HAS_GETADDRINFO
91
/* On these OSes, semaphore feature depends on semaphore.h */
92
#if defined(PJ_HAS_SEMAPHORE_H) && PJ_HAS_SEMAPHORE_H!=0
93
# define PJ_HAS_SEMAPHORE 1
94
#elif defined(PJ_WIN32) && PJ_WIN32!=0
95
# define PJ_HAS_SEMAPHORE 1
97
# define PJ_HAS_SEMAPHORE 0
100
/* Do we have pthread_mutexattr_settype()? */
101
#undef PJ_HAS_PTHREAD_MUTEXATTR_SETTYPE
103
/* Does pthread_mutexattr_t has "recursive" member? */
104
#undef PJ_PTHREAD_MUTEXATTR_T_HAS_RECURSIVE
106
/* Set 1 if native sockaddr_in has sin_len member.
109
#undef PJ_SOCKADDR_HAS_LEN
111
/* Does the OS have socklen_t? */
112
#undef PJ_HAS_SOCKLEN_T
114
#if !defined(socklen_t) && (!defined(PJ_HAS_SOCKLEN_T) || PJ_HAS_SOCKLEN_T==0)
115
# define PJ_HAS_SOCKLEN_T 1
116
typedef int socklen_t;
120
* If this macro is set, it tells select I/O Queue that select() needs to
121
* be given correct value of nfds (i.e. largest fd + 1). This requires
122
* select ioqueue to re-scan the descriptors on each registration and
124
* If this macro is not set, then ioqueue will always give FD_SETSIZE for
125
* nfds argument when calling select().
129
#undef PJ_SELECT_NEEDS_NFDS
131
/* Is errno a good way to retrieve OS errors?
133
#undef PJ_HAS_ERRNO_VAR
135
/* When this macro is set, getsockopt(SOL_SOCKET, SO_ERROR) will return
136
* the status of non-blocking connect() operation.
138
#undef PJ_HAS_SO_ERROR
140
/* This value specifies the value set in errno by the OS when a non-blocking
141
* socket recv() can not return immediate daata.
143
#undef PJ_BLOCKING_ERROR_VAL
145
/* This value specifies the value set in errno by the OS when a non-blocking
146
* socket connect() can not get connected immediately.
148
#undef PJ_BLOCKING_CONNECT_ERROR_VAL
150
/* Default threading is enabled, unless it's overridden. */
151
#ifndef PJ_HAS_THREADS
152
# define PJ_HAS_THREADS (1)
155
/* Do we need high resolution timer? */
156
#undef PJ_HAS_HIGH_RES_TIMER
158
/* Is malloc() available? */
161
#ifndef PJ_OS_HAS_CHECK_STACK
162
# define PJ_OS_HAS_CHECK_STACK 0
166
#undef PJ_NATIVE_STRING_IS_UNICODE
168
/* Pool alignment in bytes */
169
#undef PJ_POOL_ALIGNMENT
171
/* The type of atomic variable value: */
172
#undef PJ_ATOMIC_VALUE_TYPE
174
#if defined(PJ_DARWINOS) && PJ_DARWINOS!=0
175
# include "TargetConditionals.h"
176
# if TARGET_OS_IPHONE
177
# include "Availability.h"
178
/* Use CFHost API for pj_getaddrinfo() (see ticket #1246) */
179
# define PJ_GETADDRINFO_USE_CFHOST 1
180
/* Disable local host resolution in pj_gethostip() (see ticket #1342) */
181
# define PJ_GETHOSTIP_DISABLE_LOCAL_RESOLUTION 1
183
/* Is multitasking support available? (see ticket #1107) */
184
# define PJ_IPHONE_OS_HAS_MULTITASKING_SUPPORT 1
185
/* Enable activesock TCP background mode support */
186
# define PJ_ACTIVESOCK_TCP_IPHONE_OS_BG 1
191
/* If 1, use Read/Write mutex emulation for platforms that don't support it */
192
#undef PJ_EMULATE_RWMUTEX
194
/* If 1, pj_thread_create() should enforce the stack size when creating
196
* Default: 0 (let OS decide the thread's stack size).
198
#undef PJ_THREAD_SET_STACK_SIZE
200
/* If 1, pj_thread_create() should allocate stack from the pool supplied.
201
* Default: 0 (let OS allocate memory for thread's stack).
203
#undef PJ_THREAD_ALLOCATE_STACK
205
/* SSL socket availability. */
206
#ifndef PJ_HAS_SSL_SOCK
207
#undef PJ_HAS_SSL_SOCK
211
#endif /* __PJ_COMPAT_OS_AUTO_H__ */