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