blob: 12ca4341bf61678e62c0a12abedc7129b742d579 [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 Prijono0ae59ae2007-11-17 10:27:34 +000057#undef PJ_HAS_NET_IF_H
Benny Prijono1d65f702007-12-03 04:03:17 +000058#undef PJ_HAS_IFADDRS_H
Benny Prijono1c5f4e42008-02-07 13:11:39 +000059#undef PJ_HAS_SEMAPHORE_H
Benny Prijonoa9b372a2006-07-24 02:07:11 +000060#undef PJ_HAS_SETJMP_H
61#undef PJ_HAS_STDARG_H
62#undef PJ_HAS_STDDEF_H
63#undef PJ_HAS_STDIO_H
Benny Prijonofdafd402008-01-23 14:34:46 +000064#undef PJ_HAS_STDINT_H
Benny Prijonoa9b372a2006-07-24 02:07:11 +000065#undef PJ_HAS_STDLIB_H
66#undef PJ_HAS_STRING_H
67#undef PJ_HAS_SYS_IOCTL_H
68#undef PJ_HAS_SYS_SELECT_H
69#undef PJ_HAS_SYS_SOCKET_H
70#undef PJ_HAS_SYS_TIME_H
71#undef PJ_HAS_SYS_TIMEB_H
72#undef PJ_HAS_SYS_TYPES_H
73#undef PJ_HAS_TIME_H
74#undef PJ_HAS_UNISTD_H
75
76#undef PJ_HAS_MSWSOCK_H
77#undef PJ_HAS_WINSOCK_H
78#undef PJ_HAS_WINSOCK2_H
Benny Prijonoe2746132008-09-27 13:16:35 +000079#undef PJ_HAS_WS2TCPIP_H
Benny Prijonoa9b372a2006-07-24 02:07:11 +000080
81#undef PJ_SOCK_HAS_INET_ATON
Benny Prijonoc16c6e32007-11-18 14:53:47 +000082#undef PJ_SOCK_HAS_INET_PTON
83#undef PJ_SOCK_HAS_INET_NTOP
84#undef PJ_SOCK_HAS_GETADDRINFO
Benny Prijonoa9b372a2006-07-24 02:07:11 +000085
Benny Prijono1c5f4e42008-02-07 13:11:39 +000086/* On these OSes, semaphore feature depends on semaphore.h */
87#if defined(PJ_HAS_SEMAPHORE_H) && PJ_HAS_SEMAPHORE_H!=0
88# define PJ_HAS_SEMAPHORE 1
Benny Prijonoc2e34812008-02-08 15:18:20 +000089#elif defined(PJ_WIN32) && PJ_WIN32!=0
90# define PJ_HAS_SEMAPHORE 1
Benny Prijono1c5f4e42008-02-07 13:11:39 +000091#else
92# define PJ_HAS_SEMAPHORE 0
93#endif
94
95/* Do we have pthread_mutexattr_settype()? */
96#undef PJ_HAS_PTHREAD_MUTEXATTR_SETTYPE
97
98/* Does pthread_mutexattr_t has "recursive" member? */
99#undef PJ_PTHREAD_MUTEXATTR_T_HAS_RECURSIVE
100
Benny Prijonoa9b372a2006-07-24 02:07:11 +0000101/* Set 1 if native sockaddr_in has sin_len member.
102 * Default: 0
103 */
104#undef PJ_SOCKADDR_HAS_LEN
105
Benny Prijono30f85c62006-09-09 20:05:33 +0000106/* Does the OS have socklen_t? */
107#undef PJ_HAS_SOCKLEN_T
108
Benny Prijonob726d262008-07-19 18:05:04 +0000109#if !defined(socklen_t) && (!defined(PJ_HAS_SOCKLEN_T) || PJ_HAS_SOCKLEN_T==0)
Benny Prijonoc5b6dbf2006-09-10 16:33:48 +0000110# define PJ_HAS_SOCKLEN_T 1
Benny Prijono30f85c62006-09-09 20:05:33 +0000111 typedef int socklen_t;
112#endif
113
Benny Prijonoa9b372a2006-07-24 02:07:11 +0000114/**
115 * If this macro is set, it tells select I/O Queue that select() needs to
116 * be given correct value of nfds (i.e. largest fd + 1). This requires
117 * select ioqueue to re-scan the descriptors on each registration and
118 * unregistration.
119 * If this macro is not set, then ioqueue will always give FD_SETSIZE for
120 * nfds argument when calling select().
121 *
122 * Default: 0
123 */
124#undef PJ_SELECT_NEEDS_NFDS
125
126/* Is errno a good way to retrieve OS errors?
127 */
128#undef PJ_HAS_ERRNO_VAR
129
130/* When this macro is set, getsockopt(SOL_SOCKET, SO_ERROR) will return
131 * the status of non-blocking connect() operation.
132 */
133#undef PJ_HAS_SO_ERROR
134
135/* This value specifies the value set in errno by the OS when a non-blocking
136 * socket recv() can not return immediate daata.
137 */
138#undef PJ_BLOCKING_ERROR_VAL
139
140/* This value specifies the value set in errno by the OS when a non-blocking
141 * socket connect() can not get connected immediately.
142 */
143#undef PJ_BLOCKING_CONNECT_ERROR_VAL
144
145/* Default threading is enabled, unless it's overridden. */
146#ifndef PJ_HAS_THREADS
147# define PJ_HAS_THREADS (1)
148#endif
149
Benny Prijono30f85c62006-09-09 20:05:33 +0000150/* Do we need high resolution timer? */
Benny Prijonoa9b372a2006-07-24 02:07:11 +0000151#undef PJ_HAS_HIGH_RES_TIMER
Benny Prijono30f85c62006-09-09 20:05:33 +0000152
153/* Is malloc() available? */
Benny Prijonoa9b372a2006-07-24 02:07:11 +0000154#undef PJ_HAS_MALLOC
Benny Prijono30f85c62006-09-09 20:05:33 +0000155
Benny Prijonoa9b372a2006-07-24 02:07:11 +0000156#ifndef PJ_OS_HAS_CHECK_STACK
157# define PJ_OS_HAS_CHECK_STACK 0
158#endif
Benny Prijono30f85c62006-09-09 20:05:33 +0000159
160/* Unicode? */
Benny Prijonoa9b372a2006-07-24 02:07:11 +0000161#undef PJ_NATIVE_STRING_IS_UNICODE
162
Benny Prijono1d971622006-09-10 22:27:40 +0000163/* Pool alignment in bytes */
164#undef PJ_POOL_ALIGNMENT
165
Benny Prijono30f85c62006-09-09 20:05:33 +0000166/* The type of atomic variable value: */
Benny Prijonoa9b372a2006-07-24 02:07:11 +0000167#undef PJ_ATOMIC_VALUE_TYPE
168
169/* If 1, use Read/Write mutex emulation for platforms that don't support it */
170#undef PJ_EMULATE_RWMUTEX
171
172/* If 1, pj_thread_create() should enforce the stack size when creating
173 * threads.
174 * Default: 0 (let OS decide the thread's stack size).
175 */
176#undef PJ_THREAD_SET_STACK_SIZE
177
178/* If 1, pj_thread_create() should allocate stack from the pool supplied.
179 * Default: 0 (let OS allocate memory for thread's stack).
180 */
181#undef PJ_THREAD_ALLOCATE_STACK
182
183#endif /* __PJ_COMPAT_OS_AUTO_H__ */
184