blob: d9b37d284ff9e20c59a88457d74c9fb622541618 [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
78
79#undef PJ_SOCK_HAS_INET_ATON
Benny Prijonoc16c6e32007-11-18 14:53:47 +000080#undef PJ_SOCK_HAS_INET_PTON
81#undef PJ_SOCK_HAS_INET_NTOP
82#undef PJ_SOCK_HAS_GETADDRINFO
Benny Prijonoa9b372a2006-07-24 02:07:11 +000083
Benny Prijono1c5f4e42008-02-07 13:11:39 +000084/* On these OSes, semaphore feature depends on semaphore.h */
85#if defined(PJ_HAS_SEMAPHORE_H) && PJ_HAS_SEMAPHORE_H!=0
86# define PJ_HAS_SEMAPHORE 1
Benny Prijonoc2e34812008-02-08 15:18:20 +000087#elif defined(PJ_WIN32) && PJ_WIN32!=0
88# define PJ_HAS_SEMAPHORE 1
Benny Prijono1c5f4e42008-02-07 13:11:39 +000089#else
90# define PJ_HAS_SEMAPHORE 0
91#endif
92
93/* Do we have pthread_mutexattr_settype()? */
94#undef PJ_HAS_PTHREAD_MUTEXATTR_SETTYPE
95
96/* Does pthread_mutexattr_t has "recursive" member? */
97#undef PJ_PTHREAD_MUTEXATTR_T_HAS_RECURSIVE
98
Benny Prijonoa9b372a2006-07-24 02:07:11 +000099/* Set 1 if native sockaddr_in has sin_len member.
100 * Default: 0
101 */
102#undef PJ_SOCKADDR_HAS_LEN
103
Benny Prijono30f85c62006-09-09 20:05:33 +0000104/* Does the OS have socklen_t? */
105#undef PJ_HAS_SOCKLEN_T
106
Benny Prijonob726d262008-07-19 18:05:04 +0000107#if !defined(socklen_t) && (!defined(PJ_HAS_SOCKLEN_T) || PJ_HAS_SOCKLEN_T==0)
Benny Prijonoc5b6dbf2006-09-10 16:33:48 +0000108# define PJ_HAS_SOCKLEN_T 1
Benny Prijono30f85c62006-09-09 20:05:33 +0000109 typedef int socklen_t;
110#endif
111
Benny Prijonoa9b372a2006-07-24 02:07:11 +0000112/**
113 * If this macro is set, it tells select I/O Queue that select() needs to
114 * be given correct value of nfds (i.e. largest fd + 1). This requires
115 * select ioqueue to re-scan the descriptors on each registration and
116 * unregistration.
117 * If this macro is not set, then ioqueue will always give FD_SETSIZE for
118 * nfds argument when calling select().
119 *
120 * Default: 0
121 */
122#undef PJ_SELECT_NEEDS_NFDS
123
124/* Is errno a good way to retrieve OS errors?
125 */
126#undef PJ_HAS_ERRNO_VAR
127
128/* When this macro is set, getsockopt(SOL_SOCKET, SO_ERROR) will return
129 * the status of non-blocking connect() operation.
130 */
131#undef PJ_HAS_SO_ERROR
132
133/* This value specifies the value set in errno by the OS when a non-blocking
134 * socket recv() can not return immediate daata.
135 */
136#undef PJ_BLOCKING_ERROR_VAL
137
138/* This value specifies the value set in errno by the OS when a non-blocking
139 * socket connect() can not get connected immediately.
140 */
141#undef PJ_BLOCKING_CONNECT_ERROR_VAL
142
143/* Default threading is enabled, unless it's overridden. */
144#ifndef PJ_HAS_THREADS
145# define PJ_HAS_THREADS (1)
146#endif
147
Benny Prijono30f85c62006-09-09 20:05:33 +0000148/* Do we need high resolution timer? */
Benny Prijonoa9b372a2006-07-24 02:07:11 +0000149#undef PJ_HAS_HIGH_RES_TIMER
Benny Prijono30f85c62006-09-09 20:05:33 +0000150
151/* Is malloc() available? */
Benny Prijonoa9b372a2006-07-24 02:07:11 +0000152#undef PJ_HAS_MALLOC
Benny Prijono30f85c62006-09-09 20:05:33 +0000153
Benny Prijonoa9b372a2006-07-24 02:07:11 +0000154#ifndef PJ_OS_HAS_CHECK_STACK
155# define PJ_OS_HAS_CHECK_STACK 0
156#endif
Benny Prijono30f85c62006-09-09 20:05:33 +0000157
158/* Unicode? */
Benny Prijonoa9b372a2006-07-24 02:07:11 +0000159#undef PJ_NATIVE_STRING_IS_UNICODE
160
Benny Prijono1d971622006-09-10 22:27:40 +0000161/* Pool alignment in bytes */
162#undef PJ_POOL_ALIGNMENT
163
Benny Prijono30f85c62006-09-09 20:05:33 +0000164/* The type of atomic variable value: */
Benny Prijonoa9b372a2006-07-24 02:07:11 +0000165#undef PJ_ATOMIC_VALUE_TYPE
166
167/* If 1, use Read/Write mutex emulation for platforms that don't support it */
168#undef PJ_EMULATE_RWMUTEX
169
170/* If 1, pj_thread_create() should enforce the stack size when creating
171 * threads.
172 * Default: 0 (let OS decide the thread's stack size).
173 */
174#undef PJ_THREAD_SET_STACK_SIZE
175
176/* If 1, pj_thread_create() should allocate stack from the pool supplied.
177 * Default: 0 (let OS allocate memory for thread's stack).
178 */
179#undef PJ_THREAD_ALLOCATE_STACK
180
181#endif /* __PJ_COMPAT_OS_AUTO_H__ */
182