blob: b12923732a75b3ed43b4d47517d0d84714839968 [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
49#undef PJ_HAS_LINUX_SOCKET_H
50#undef PJ_HAS_MALLOC_H
51#undef PJ_HAS_NETDB_H
52#undef PJ_HAS_NETINET_IN_H
Benny Prijono87a00892007-02-01 00:33:12 +000053#undef PJ_HAS_NETINET_IP_H
Benny Prijonoa9b372a2006-07-24 02:07:11 +000054#undef PJ_HAS_SETJMP_H
55#undef PJ_HAS_STDARG_H
56#undef PJ_HAS_STDDEF_H
57#undef PJ_HAS_STDIO_H
58#undef PJ_HAS_STDLIB_H
59#undef PJ_HAS_STRING_H
60#undef PJ_HAS_SYS_IOCTL_H
61#undef PJ_HAS_SYS_SELECT_H
62#undef PJ_HAS_SYS_SOCKET_H
63#undef PJ_HAS_SYS_TIME_H
64#undef PJ_HAS_SYS_TIMEB_H
65#undef PJ_HAS_SYS_TYPES_H
66#undef PJ_HAS_TIME_H
67#undef PJ_HAS_UNISTD_H
68
69#undef PJ_HAS_MSWSOCK_H
70#undef PJ_HAS_WINSOCK_H
71#undef PJ_HAS_WINSOCK2_H
72
73#undef PJ_SOCK_HAS_INET_ATON
74
75/* Set 1 if native sockaddr_in has sin_len member.
76 * Default: 0
77 */
78#undef PJ_SOCKADDR_HAS_LEN
79
Benny Prijono30f85c62006-09-09 20:05:33 +000080/* Does the OS have socklen_t? */
81#undef PJ_HAS_SOCKLEN_T
82
83#if !defined(PJ_HAS_SOCKLEN_T) || PJ_HAS_SOCKLEN_T==0
Benny Prijonoc5b6dbf2006-09-10 16:33:48 +000084# define PJ_HAS_SOCKLEN_T 1
Benny Prijono30f85c62006-09-09 20:05:33 +000085 typedef int socklen_t;
86#endif
87
Benny Prijonoa9b372a2006-07-24 02:07:11 +000088/**
89 * If this macro is set, it tells select I/O Queue that select() needs to
90 * be given correct value of nfds (i.e. largest fd + 1). This requires
91 * select ioqueue to re-scan the descriptors on each registration and
92 * unregistration.
93 * If this macro is not set, then ioqueue will always give FD_SETSIZE for
94 * nfds argument when calling select().
95 *
96 * Default: 0
97 */
98#undef PJ_SELECT_NEEDS_NFDS
99
100/* Is errno a good way to retrieve OS errors?
101 */
102#undef PJ_HAS_ERRNO_VAR
103
104/* When this macro is set, getsockopt(SOL_SOCKET, SO_ERROR) will return
105 * the status of non-blocking connect() operation.
106 */
107#undef PJ_HAS_SO_ERROR
108
109/* This value specifies the value set in errno by the OS when a non-blocking
110 * socket recv() can not return immediate daata.
111 */
112#undef PJ_BLOCKING_ERROR_VAL
113
114/* This value specifies the value set in errno by the OS when a non-blocking
115 * socket connect() can not get connected immediately.
116 */
117#undef PJ_BLOCKING_CONNECT_ERROR_VAL
118
119/* Default threading is enabled, unless it's overridden. */
120#ifndef PJ_HAS_THREADS
121# define PJ_HAS_THREADS (1)
122#endif
123
Benny Prijono30f85c62006-09-09 20:05:33 +0000124/* Do we need high resolution timer? */
Benny Prijonoa9b372a2006-07-24 02:07:11 +0000125#undef PJ_HAS_HIGH_RES_TIMER
Benny Prijono30f85c62006-09-09 20:05:33 +0000126
127/* Is malloc() available? */
Benny Prijonoa9b372a2006-07-24 02:07:11 +0000128#undef PJ_HAS_MALLOC
Benny Prijono30f85c62006-09-09 20:05:33 +0000129
Benny Prijonoa9b372a2006-07-24 02:07:11 +0000130#ifndef PJ_OS_HAS_CHECK_STACK
131# define PJ_OS_HAS_CHECK_STACK 0
132#endif
Benny Prijono30f85c62006-09-09 20:05:33 +0000133
134/* Unicode? */
Benny Prijonoa9b372a2006-07-24 02:07:11 +0000135#undef PJ_NATIVE_STRING_IS_UNICODE
136
Benny Prijono1d971622006-09-10 22:27:40 +0000137/* Pool alignment in bytes */
138#undef PJ_POOL_ALIGNMENT
139
Benny Prijono30f85c62006-09-09 20:05:33 +0000140/* The type of atomic variable value: */
Benny Prijonoa9b372a2006-07-24 02:07:11 +0000141#undef PJ_ATOMIC_VALUE_TYPE
142
143/* If 1, use Read/Write mutex emulation for platforms that don't support it */
144#undef PJ_EMULATE_RWMUTEX
145
146/* If 1, pj_thread_create() should enforce the stack size when creating
147 * threads.
148 * Default: 0 (let OS decide the thread's stack size).
149 */
150#undef PJ_THREAD_SET_STACK_SIZE
151
152/* If 1, pj_thread_create() should allocate stack from the pool supplied.
153 * Default: 0 (let OS allocate memory for thread's stack).
154 */
155#undef PJ_THREAD_ALLOCATE_STACK
156
157#endif /* __PJ_COMPAT_OS_AUTO_H__ */
158