blob: 8c65c8f9d3bad24505cd7a3067ccf518a8314581 [file] [log] [blame]
Benny Prijonoa9b372a2006-07-24 02:07:11 +00001/* $Id$ */
2/*
3 * Copyright (C)2003-2006 Benny Prijono <benny@prijono.org>
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
Benny Prijonoc5b6dbf2006-09-10 16:33:48 +000031/* Legacy macros */
32#undef PJ_WIN32
33#undef PJ_WIN32_WINNT
34#undef WIN32_LEAN_AND_MEAN
35#undef PJ_DARWINOS
36#undef PJ_LINUX
37#undef PJ_RTEMS
38#undef PJ_SUNOS
39
40#if defined(PJ_WIN32_WINNT) && !defined(_WIN32_WINNT)
41# define _WIN32_WINNT PJ_WIN32_WINNT
42#endif
43
Benny Prijonoa9b372a2006-07-24 02:07:11 +000044/* Headers availability */
45#undef PJ_HAS_ARPA_INET_H
46#undef PJ_HAS_ASSERT_H
47#undef PJ_HAS_CTYPE_H
48#undef PJ_HAS_ERRNO_H
Benny Prijono1d481ab2008-01-24 15:27:30 +000049#undef PJ_HAS_FCNTL_H
Benny Prijonoa9b372a2006-07-24 02:07:11 +000050#undef PJ_HAS_LINUX_SOCKET_H
51#undef PJ_HAS_MALLOC_H
52#undef PJ_HAS_NETDB_H
Benny Prijono37fc9de2008-08-04 14:45:02 +000053#undef PJ_HAS_NETINET_IN_SYSTM_H
Benny Prijonoa9b372a2006-07-24 02:07:11 +000054#undef PJ_HAS_NETINET_IN_H
Benny Prijono87a00892007-02-01 00:33:12 +000055#undef PJ_HAS_NETINET_IP_H
Benny Prijono0ae59ae2007-11-17 10:27:34 +000056#undef PJ_HAS_NET_IF_H
Benny Prijono1d65f702007-12-03 04:03:17 +000057#undef PJ_HAS_IFADDRS_H
Benny Prijono1c5f4e42008-02-07 13:11:39 +000058#undef PJ_HAS_SEMAPHORE_H
Benny Prijonoa9b372a2006-07-24 02:07:11 +000059#undef PJ_HAS_SETJMP_H
60#undef PJ_HAS_STDARG_H
61#undef PJ_HAS_STDDEF_H
62#undef PJ_HAS_STDIO_H
Benny Prijonofdafd402008-01-23 14:34:46 +000063#undef PJ_HAS_STDINT_H
Benny Prijonoa9b372a2006-07-24 02:07:11 +000064#undef PJ_HAS_STDLIB_H
65#undef PJ_HAS_STRING_H
66#undef PJ_HAS_SYS_IOCTL_H
67#undef PJ_HAS_SYS_SELECT_H
68#undef PJ_HAS_SYS_SOCKET_H
69#undef PJ_HAS_SYS_TIME_H
70#undef PJ_HAS_SYS_TIMEB_H
71#undef PJ_HAS_SYS_TYPES_H
72#undef PJ_HAS_TIME_H
73#undef PJ_HAS_UNISTD_H
74
75#undef PJ_HAS_MSWSOCK_H
76#undef PJ_HAS_WINSOCK_H
77#undef PJ_HAS_WINSOCK2_H
Benny Prijonoe2746132008-09-27 13:16:35 +000078#undef PJ_HAS_WS2TCPIP_H
Benny Prijonoa9b372a2006-07-24 02:07:11 +000079
80#undef PJ_SOCK_HAS_INET_ATON
Benny Prijonoc16c6e32007-11-18 14:53:47 +000081#undef PJ_SOCK_HAS_INET_PTON
82#undef PJ_SOCK_HAS_INET_NTOP
83#undef PJ_SOCK_HAS_GETADDRINFO
Benny Prijonoa9b372a2006-07-24 02:07:11 +000084
Benny Prijono1c5f4e42008-02-07 13:11:39 +000085/* On these OSes, semaphore feature depends on semaphore.h */
86#if defined(PJ_HAS_SEMAPHORE_H) && PJ_HAS_SEMAPHORE_H!=0
87# define PJ_HAS_SEMAPHORE 1
Benny Prijonoc2e34812008-02-08 15:18:20 +000088#elif defined(PJ_WIN32) && PJ_WIN32!=0
89# define PJ_HAS_SEMAPHORE 1
Benny Prijono1c5f4e42008-02-07 13:11:39 +000090#else
91# define PJ_HAS_SEMAPHORE 0
92#endif
93
94/* Do we have pthread_mutexattr_settype()? */
95#undef PJ_HAS_PTHREAD_MUTEXATTR_SETTYPE
96
97/* Does pthread_mutexattr_t has "recursive" member? */
98#undef PJ_PTHREAD_MUTEXATTR_T_HAS_RECURSIVE
99
Benny Prijonoa9b372a2006-07-24 02:07:11 +0000100/* Set 1 if native sockaddr_in has sin_len member.
101 * Default: 0
102 */
103#undef PJ_SOCKADDR_HAS_LEN
104
Benny Prijono30f85c62006-09-09 20:05:33 +0000105/* Does the OS have socklen_t? */
106#undef PJ_HAS_SOCKLEN_T
107
Benny Prijonob726d262008-07-19 18:05:04 +0000108#if !defined(socklen_t) && (!defined(PJ_HAS_SOCKLEN_T) || PJ_HAS_SOCKLEN_T==0)
Benny Prijonoc5b6dbf2006-09-10 16:33:48 +0000109# define PJ_HAS_SOCKLEN_T 1
Benny Prijono30f85c62006-09-09 20:05:33 +0000110 typedef int socklen_t;
111#endif
112
Benny Prijonoa9b372a2006-07-24 02:07:11 +0000113/**
114 * If this macro is set, it tells select I/O Queue that select() needs to
115 * be given correct value of nfds (i.e. largest fd + 1). This requires
116 * select ioqueue to re-scan the descriptors on each registration and
117 * unregistration.
118 * If this macro is not set, then ioqueue will always give FD_SETSIZE for
119 * nfds argument when calling select().
120 *
121 * Default: 0
122 */
123#undef PJ_SELECT_NEEDS_NFDS
124
125/* Is errno a good way to retrieve OS errors?
126 */
127#undef PJ_HAS_ERRNO_VAR
128
129/* When this macro is set, getsockopt(SOL_SOCKET, SO_ERROR) will return
130 * the status of non-blocking connect() operation.
131 */
132#undef PJ_HAS_SO_ERROR
133
134/* This value specifies the value set in errno by the OS when a non-blocking
135 * socket recv() can not return immediate daata.
136 */
137#undef PJ_BLOCKING_ERROR_VAL
138
139/* This value specifies the value set in errno by the OS when a non-blocking
140 * socket connect() can not get connected immediately.
141 */
142#undef PJ_BLOCKING_CONNECT_ERROR_VAL
143
144/* Default threading is enabled, unless it's overridden. */
145#ifndef PJ_HAS_THREADS
146# define PJ_HAS_THREADS (1)
147#endif
148
Benny Prijono30f85c62006-09-09 20:05:33 +0000149/* Do we need high resolution timer? */
Benny Prijonoa9b372a2006-07-24 02:07:11 +0000150#undef PJ_HAS_HIGH_RES_TIMER
Benny Prijono30f85c62006-09-09 20:05:33 +0000151
152/* Is malloc() available? */
Benny Prijonoa9b372a2006-07-24 02:07:11 +0000153#undef PJ_HAS_MALLOC
Benny Prijono30f85c62006-09-09 20:05:33 +0000154
Benny Prijonoa9b372a2006-07-24 02:07:11 +0000155#ifndef PJ_OS_HAS_CHECK_STACK
156# define PJ_OS_HAS_CHECK_STACK 0
157#endif
Benny Prijono30f85c62006-09-09 20:05:33 +0000158
159/* Unicode? */
Benny Prijonoa9b372a2006-07-24 02:07:11 +0000160#undef PJ_NATIVE_STRING_IS_UNICODE
161
Benny Prijono1d971622006-09-10 22:27:40 +0000162/* Pool alignment in bytes */
163#undef PJ_POOL_ALIGNMENT
164
Benny Prijono30f85c62006-09-09 20:05:33 +0000165/* The type of atomic variable value: */
Benny Prijonoa9b372a2006-07-24 02:07:11 +0000166#undef PJ_ATOMIC_VALUE_TYPE
167
168/* If 1, use Read/Write mutex emulation for platforms that don't support it */
169#undef PJ_EMULATE_RWMUTEX
170
171/* If 1, pj_thread_create() should enforce the stack size when creating
172 * threads.
173 * Default: 0 (let OS decide the thread's stack size).
174 */
175#undef PJ_THREAD_SET_STACK_SIZE
176
177/* If 1, pj_thread_create() should allocate stack from the pool supplied.
178 * Default: 0 (let OS allocate memory for thread's stack).
179 */
180#undef PJ_THREAD_ALLOCATE_STACK
181
182#endif /* __PJ_COMPAT_OS_AUTO_H__ */
183