blob: 403d89190ef3693da29ccb463a3e1e1938db8804 [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
31/* Headers availability */
32#undef PJ_HAS_ARPA_INET_H
33#undef PJ_HAS_ASSERT_H
34#undef PJ_HAS_CTYPE_H
35#undef PJ_HAS_ERRNO_H
36#undef PJ_HAS_LINUX_SOCKET_H
37#undef PJ_HAS_MALLOC_H
38#undef PJ_HAS_NETDB_H
39#undef PJ_HAS_NETINET_IN_H
40#undef PJ_HAS_SETJMP_H
41#undef PJ_HAS_STDARG_H
42#undef PJ_HAS_STDDEF_H
43#undef PJ_HAS_STDIO_H
44#undef PJ_HAS_STDLIB_H
45#undef PJ_HAS_STRING_H
46#undef PJ_HAS_SYS_IOCTL_H
47#undef PJ_HAS_SYS_SELECT_H
48#undef PJ_HAS_SYS_SOCKET_H
49#undef PJ_HAS_SYS_TIME_H
50#undef PJ_HAS_SYS_TIMEB_H
51#undef PJ_HAS_SYS_TYPES_H
52#undef PJ_HAS_TIME_H
53#undef PJ_HAS_UNISTD_H
54
55#undef PJ_HAS_MSWSOCK_H
56#undef PJ_HAS_WINSOCK_H
57#undef PJ_HAS_WINSOCK2_H
58
59#undef PJ_SOCK_HAS_INET_ATON
60
61/* Set 1 if native sockaddr_in has sin_len member.
62 * Default: 0
63 */
64#undef PJ_SOCKADDR_HAS_LEN
65
Benny Prijono30f85c62006-09-09 20:05:33 +000066/* Does the OS have socklen_t? */
67#undef PJ_HAS_SOCKLEN_T
68
69#if !defined(PJ_HAS_SOCKLEN_T) || PJ_HAS_SOCKLEN_T==0
70 typedef int socklen_t;
71#endif
72
Benny Prijonoa9b372a2006-07-24 02:07:11 +000073/**
74 * If this macro is set, it tells select I/O Queue that select() needs to
75 * be given correct value of nfds (i.e. largest fd + 1). This requires
76 * select ioqueue to re-scan the descriptors on each registration and
77 * unregistration.
78 * If this macro is not set, then ioqueue will always give FD_SETSIZE for
79 * nfds argument when calling select().
80 *
81 * Default: 0
82 */
83#undef PJ_SELECT_NEEDS_NFDS
84
85/* Is errno a good way to retrieve OS errors?
86 */
87#undef PJ_HAS_ERRNO_VAR
88
89/* When this macro is set, getsockopt(SOL_SOCKET, SO_ERROR) will return
90 * the status of non-blocking connect() operation.
91 */
92#undef PJ_HAS_SO_ERROR
93
94/* This value specifies the value set in errno by the OS when a non-blocking
95 * socket recv() can not return immediate daata.
96 */
97#undef PJ_BLOCKING_ERROR_VAL
98
99/* This value specifies the value set in errno by the OS when a non-blocking
100 * socket connect() can not get connected immediately.
101 */
102#undef PJ_BLOCKING_CONNECT_ERROR_VAL
103
104/* Default threading is enabled, unless it's overridden. */
105#ifndef PJ_HAS_THREADS
106# define PJ_HAS_THREADS (1)
107#endif
108
Benny Prijono30f85c62006-09-09 20:05:33 +0000109/* Do we need high resolution timer? */
Benny Prijonoa9b372a2006-07-24 02:07:11 +0000110#undef PJ_HAS_HIGH_RES_TIMER
Benny Prijono30f85c62006-09-09 20:05:33 +0000111
112/* Is malloc() available? */
Benny Prijonoa9b372a2006-07-24 02:07:11 +0000113#undef PJ_HAS_MALLOC
Benny Prijono30f85c62006-09-09 20:05:33 +0000114
Benny Prijonoa9b372a2006-07-24 02:07:11 +0000115#ifndef PJ_OS_HAS_CHECK_STACK
116# define PJ_OS_HAS_CHECK_STACK 0
117#endif
Benny Prijono30f85c62006-09-09 20:05:33 +0000118
119/* Unicode? */
Benny Prijonoa9b372a2006-07-24 02:07:11 +0000120#undef PJ_NATIVE_STRING_IS_UNICODE
121
Benny Prijono30f85c62006-09-09 20:05:33 +0000122/* The type of atomic variable value: */
Benny Prijonoa9b372a2006-07-24 02:07:11 +0000123#undef PJ_ATOMIC_VALUE_TYPE
124
125/* If 1, use Read/Write mutex emulation for platforms that don't support it */
126#undef PJ_EMULATE_RWMUTEX
127
128/* If 1, pj_thread_create() should enforce the stack size when creating
129 * threads.
130 * Default: 0 (let OS decide the thread's stack size).
131 */
132#undef PJ_THREAD_SET_STACK_SIZE
133
134/* If 1, pj_thread_create() should allocate stack from the pool supplied.
135 * Default: 0 (let OS allocate memory for thread's stack).
136 */
137#undef PJ_THREAD_ALLOCATE_STACK
138
139#endif /* __PJ_COMPAT_OS_AUTO_H__ */
140