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