|
Home --> Documentations --> PJLIB Reference
Go to the documentation of this file.
20 #ifndef __PJ_CONFIG_H__
21 #define __PJ_CONFIG_H__
33 # include <pj/compat/cc_msvc.h>
34 #elif defined(__GNUC__)
35 # include <pj/compat/cc_gcc.h>
36 #elif defined(__CW32__)
37 # include <pj/compat/cc_mwcc.h>
38 #elif defined(__MWERKS__)
39 # include <pj/compat/cc_codew.h>
40 #elif defined(__GCCE__)
41 # include <pj/compat/cc_gcce.h>
42 #elif defined(__ARMCC__)
43 # include <pj/compat/cc_armcc.h>
45 # error "Unknown compiler."
50 # error "PJ_ALIGN_DATA is not defined!"
56 #if defined(PJ_AUTOCONF)
60 # include <pj/compat/os_auto.h>
62 #elif defined(PJ_SYMBIAN) && PJ_SYMBIAN!=0
66 # include <pj/compat/os_symbian.h>
68 #elif defined(PJ_WIN32_WINCE) || defined(_WIN32_WCE) || defined(UNDER_CE)
72 # undef PJ_WIN32_WINCE
73 # define PJ_WIN32_WINCE 1
74 # include <pj/compat/os_win32_wince.h>
79 #elif defined(PJ_WIN32) || defined(_WIN32) || defined(__WIN32__) || \
80 defined(_WIN64) || defined(WIN32) || defined(__TOS_WIN__)
86 # include <pj/compat/os_win32.h>
88 #elif defined(PJ_LINUX_KERNEL) && PJ_LINUX_KERNEL!=0
92 # include <pj/compat/os_linux_kernel.h>
94 #elif defined(PJ_LINUX) || defined(linux) || defined(__linux)
100 # include <pj/compat/os_linux.h>
102 #elif defined(PJ_PALMOS) && PJ_PALMOS!=0
106 # include <pj/compat/os_palmos.h>
108 #elif defined(PJ_SUNOS) || defined(sun) || defined(__sun)
114 # include <pj/compat/os_sunos.h>
116 #elif defined(PJ_DARWINOS) || defined(__MACOSX__) || \
117 defined (__APPLE__) || defined (__MACH__)
122 # define PJ_DARWINOS 1
123 # include <pj/compat/os_darwinos.h>
125 #elif defined(PJ_RTEMS) && PJ_RTEMS!=0
129 # include <pj/compat/os_rtems.h>
131 # error "Please specify target os."
138 #if defined(PJ_AUTOCONF)
142 #include <pj/compat/m_auto.h>
144 #elif defined (PJ_M_I386) || defined(_i386_) || defined(i_386_) || \
145 defined(_X86_) || defined(x86) || defined(__i386__) || \
146 defined(__i386) || defined(_M_IX86) || defined(__I86__)
152 # define PJ_M_NAME "i386"
153 # define PJ_HAS_PENTIUM 1
154 # define PJ_IS_LITTLE_ENDIAN 1
155 # define PJ_IS_BIG_ENDIAN 0
158 #elif defined (PJ_M_X86_64) || defined(__amd64__) || defined(__amd64) || \
159 defined(__x86_64__) || defined(__x86_64)
164 # define PJ_M_X86_64 1
165 # define PJ_M_NAME "x86_64"
166 # define PJ_HAS_PENTIUM 1
167 # define PJ_IS_LITTLE_ENDIAN 1
168 # define PJ_IS_BIG_ENDIAN 0
170 #elif defined(PJ_M_IA64) || defined(__ia64__) || defined(_IA64) || \
171 defined(__IA64__) || defined( _M_IA64)
177 # define PJ_M_NAME "ia64"
178 # define PJ_HAS_PENTIUM 1
179 # define PJ_IS_LITTLE_ENDIAN 1
180 # define PJ_IS_BIG_ENDIAN 0
182 #elif defined (PJ_M_M68K) && PJ_M_M68K != 0
189 # define PJ_M_NAME "m68k"
190 # define PJ_HAS_PENTIUM 0
191 # define PJ_IS_LITTLE_ENDIAN 0
192 # define PJ_IS_BIG_ENDIAN 1
195 #elif defined (PJ_M_ALPHA) || defined (__alpha__) || defined (__alpha) || \
201 # define PJ_M_ALPHA 1
202 # define PJ_M_NAME "alpha"
203 # define PJ_HAS_PENTIUM 0
204 # define PJ_IS_LITTLE_ENDIAN 1
205 # define PJ_IS_BIG_ENDIAN 0
208 #elif defined(PJ_M_MIPS) || defined(__mips__) || defined(__mips) || \
209 defined(__MIPS__) || defined(MIPS) || defined(_MIPS_)
215 # define PJ_M_NAME "mips"
216 # define PJ_HAS_PENTIUM 0
217 # if !PJ_IS_LITTLE_ENDIAN && !PJ_IS_BIG_ENDIAN
218 # error Endianness must be declared for this processor
222 #elif defined (PJ_M_SPARC) || defined( __sparc__) || defined(__sparc)
227 # define PJ_M_SPARC 1
228 # define PJ_M_NAME "sparc"
229 # define PJ_HAS_PENTIUM 0
230 # define PJ_IS_LITTLE_ENDIAN 0
231 # define PJ_IS_BIG_ENDIAN 1
233 #elif defined (PJ_M_ARMV4) || defined(ARM) || defined(_ARM_) || \
234 defined(ARMV4) || defined(__arm__)
239 # define PJ_M_ARMV4 1
240 # define PJ_M_NAME "armv4"
241 # define PJ_HAS_PENTIUM 0
242 # if !PJ_IS_LITTLE_ENDIAN && !PJ_IS_BIG_ENDIAN
243 # error Endianness must be declared for this processor
246 #elif defined (PJ_M_POWERPC) || defined(__powerpc) || defined(__powerpc__) || \
247 defined(__POWERPC__) || defined(__ppc__) || defined(_M_PPC) || \
253 # define PJ_M_POWERPC 1
254 # define PJ_M_NAME "powerpc"
255 # define PJ_HAS_PENTIUM 0
256 # if !PJ_IS_LITTLE_ENDIAN && !PJ_IS_BIG_ENDIAN
257 # error Endianness must be declared for this processor
260 #elif defined (PJ_M_NIOS2) || defined(__nios2) || defined(__nios2__) || \
261 defined(__NIOS2__) || defined(__M_NIOS2) || defined(_ARCH_NIOS2)
266 # define PJ_M_NIOS2 1
267 # define PJ_M_NAME "nios2"
268 # define PJ_HAS_PENTIUM 0
269 # define PJ_IS_LITTLE_ENDIAN 1
270 # define PJ_IS_BIG_ENDIAN 0
273 # error "Please specify target machine."
277 #include <pj/compat/size_t.h>
282 #include <pj/config_site.h>
290 # undef PJ_FUNCTIONS_ARE_INLINED
291 # undef PJ_HAS_FLOATING_POINT
292 # undef PJ_LOG_MAX_LEVEL
293 # undef PJ_LOG_MAX_SIZE
294 # undef PJ_LOG_USE_STACK_BUFFER
295 # undef PJ_TERM_HAS_COLOR
296 # undef PJ_POOL_DEBUG
298 # undef PJ_MAX_HOSTNAME
299 # undef PJ_IOQUEUE_MAX_HANDLES
301 # undef PJ_HAS_SEMAPHORE
302 # undef PJ_HAS_EVENT_OBJ
303 # undef PJ_ENABLE_EXTRA_CHECK
304 # undef PJ_EXCEPTION_USE_WIN32_SEH
305 # undef PJ_HAS_ERROR_STRING
307 # define PJ_HAS_IPV6 1
343 #ifndef PJ_DEBUG_MUTEX
344 # define PJ_DEBUG_MUTEX 0
352 #ifndef PJ_FUNCTIONS_ARE_INLINED
353 # define PJ_FUNCTIONS_ARE_INLINED 0
361 #ifndef PJ_HAS_FLOATING_POINT
362 # define PJ_HAS_FLOATING_POINT 1
382 #ifndef PJ_LOG_MAX_LEVEL
383 # define PJ_LOG_MAX_LEVEL 5
394 #ifndef PJ_LOG_MAX_SIZE
395 # define PJ_LOG_MAX_SIZE 4000
406 #ifndef PJ_LOG_USE_STACK_BUFFER
407 # define PJ_LOG_USE_STACK_BUFFER 1
415 #ifndef PJ_LOG_ENABLE_INDENT
416 # define PJ_LOG_ENABLE_INDENT 1
425 #ifndef PJ_LOG_INDENT_SIZE
426 # define PJ_LOG_INDENT_SIZE 1
434 #ifndef PJ_LOG_INDENT_CHAR
435 # define PJ_LOG_INDENT_CHAR '.'
443 #ifndef PJ_TERM_HAS_COLOR
444 # define PJ_TERM_HAS_COLOR 1
460 # define PJ_SAFE_POOL 0
472 #ifndef PJ_POOL_DEBUG
473 # define PJ_POOL_DEBUG 0
485 #ifndef PJ_TIMER_DEBUG
486 # define PJ_TIMER_DEBUG 0
493 #ifndef PJ_GRP_LOCK_DEBUG
494 # define PJ_GRP_LOCK_DEBUG 0
504 #ifndef PJ_THREAD_DEFAULT_STACK_SIZE
505 # define PJ_THREAD_DEFAULT_STACK_SIZE 8192
516 #ifndef PJ_OS_HAS_CHECK_STACK
517 # define PJ_OS_HAS_CHECK_STACK 0
525 #ifndef PJ_HAS_POOL_ALT_API
526 # define PJ_HAS_POOL_ALT_API PJ_POOL_DEBUG
537 # define PJ_HAS_TCP 1
547 # define PJ_HAS_IPV6 0
557 #ifndef PJ_MAX_HOSTNAME
558 # define PJ_MAX_HOSTNAME (128)
567 #ifndef PJ_ACTIVESOCK_MAX_CONSECUTIVE_ACCEPT_ERROR
568 # define PJ_ACTIVESOCK_MAX_CONSECUTIVE_ACCEPT_ERROR 50
578 #ifndef PJ_IOQUEUE_MAX_HANDLES
579 # define PJ_IOQUEUE_MAX_HANDLES (64)
599 #ifndef PJ_IOQUEUE_HAS_SAFE_UNREG
600 # define PJ_IOQUEUE_HAS_SAFE_UNREG 1
615 #ifndef PJ_IOQUEUE_DEFAULT_ALLOW_CONCURRENCY
616 # define PJ_IOQUEUE_DEFAULT_ALLOW_CONCURRENCY 1
624 #if (PJ_IOQUEUE_DEFAULT_ALLOW_CONCURRENCY==0) && (PJ_IOQUEUE_HAS_SAFE_UNREG==0)
625 # error PJ_IOQUEUE_HAS_SAFE_UNREG must be enabled if ioqueue concurrency \
639 #ifndef PJ_IOQUEUE_KEY_FREE_DELAY
640 # define PJ_IOQUEUE_KEY_FREE_DELAY 500
649 #ifndef PJ_FD_SETSIZE_SETABLE
650 # if (defined(PJ_HAS_WINSOCK_H) && PJ_HAS_WINSOCK_H!=0) || \
651 (defined(PJ_HAS_WINSOCK2_H) && PJ_HAS_WINSOCK2_H!=0)
652 # define PJ_FD_SETSIZE_SETABLE 1
654 # define PJ_FD_SETSIZE_SETABLE 0
664 #if PJ_FD_SETSIZE_SETABLE
667 # define FD_SETSIZE PJ_IOQUEUE_MAX_HANDLES
674 # if PJ_IOQUEUE_MAX_HANDLES > FD_SETSIZE
675 # error "PJ_IOQUEUE_MAX_HANDLES is greater than FD_SETSIZE"
687 #ifndef PJ_IP_HELPER_IGNORE_LOOPBACK_IF
688 # define PJ_IP_HELPER_IGNORE_LOOPBACK_IF 1
697 #ifndef PJ_HAS_SEMAPHORE
698 # define PJ_HAS_SEMAPHORE 1
707 #ifndef PJ_HAS_EVENT_OBJ
708 # define PJ_HAS_EVENT_OBJ 1
716 # define PJ_MAXPATH 260
731 #ifndef PJ_ENABLE_EXTRA_CHECK
732 # define PJ_ENABLE_EXTRA_CHECK 1
747 #ifndef PJ_HAS_EXCEPTION_NAMES
748 # define PJ_HAS_EXCEPTION_NAMES 1
758 #ifndef PJ_MAX_EXCEPTION_ID
759 # define PJ_MAX_EXCEPTION_ID 16
768 #ifndef PJ_EXCEPTION_USE_WIN32_SEH
769 # define PJ_EXCEPTION_USE_WIN32_SEH 0
778 #ifndef PJ_TIMESTAMP_USE_RDTSC
779 # define PJ_TIMESTAMP_USE_RDTSC 0
786 #ifndef PJ_NATIVE_ERR_POSITIVE
787 # define PJ_NATIVE_ERR_POSITIVE 1
796 #ifndef PJ_HAS_ERROR_STRING
797 # define PJ_HAS_ERROR_STRING 1
809 #ifndef PJ_HAS_STRICMP_ALNUM
810 # define PJ_HAS_STRICMP_ALNUM 0
822 #define PJ_QOS_DUMMY 1
831 #define PJ_QOS_SYMBIAN 4
836 #ifndef PJ_QOS_IMPLEMENTATION
837 # if defined(PJ_WIN32_WINCE) && PJ_WIN32_WINCE && _WIN32_WCE >= 0x502
839 # define PJ_QOS_IMPLEMENTATION PJ_QOS_WM
851 #ifndef PJ_HAS_SSL_SOCK
852 # define PJ_HAS_SSL_SOCK 0
862 #ifndef PJ_SOCK_DISABLE_WSAECONNRESET
863 # define PJ_SOCK_DISABLE_WSAECONNRESET 1
955 #define PJ_INLINE(type) PJ_INLINE_SPECIFIER type
965 #ifndef PJ_EXPORT_DECL_SPECIFIER
966 # define PJ_EXPORT_DECL_SPECIFIER
978 #ifndef PJ_EXPORT_DEF_SPECIFIER
979 # define PJ_EXPORT_DEF_SPECIFIER
990 #ifndef PJ_IMPORT_DECL_SPECIFIER
991 # define PJ_IMPORT_DECL_SPECIFIER
998 #ifndef PJ_EXPORT_SYMBOL
999 # define PJ_EXPORT_SYMBOL(x)
1009 # if defined(PJ_EXPORTING)
1010 # define PJ_DECL(type) PJ_EXPORT_DECL_SPECIFIER type
1012 # define PJ_DECL(type) PJ_IMPORT_DECL_SPECIFIER type
1014 #elif !defined(PJ_DECL)
1015 # if defined(__cplusplus)
1016 # define PJ_DECL(type) type
1018 # define PJ_DECL(type) extern type
1028 #if defined(PJ_DLL) && defined(PJ_EXPORTING)
1029 # define PJ_DEF(type) PJ_EXPORT_DEF_SPECIFIER type
1030 #elif !defined(PJ_DEF)
1031 # define PJ_DEF(type) type
1054 # define PJ_DECL_NO_RETURN(type) PJ_DECL(type) PJ_NORETURN
1055 # define PJ_IDECL_NO_RETURN(type) PJ_INLINE(type) PJ_NORETURN
1056 # define PJ_BEGIN_DECL extern "C" {
1057 # define PJ_END_DECL }
1059 # define PJ_DECL_NO_RETURN(type) PJ_NORETURN PJ_DECL(type)
1060 # define PJ_IDECL_NO_RETURN(type) PJ_NORETURN PJ_INLINE(type)
1061 # define PJ_BEGIN_DECL
1062 # define PJ_END_DECL
1073 # if defined(PJ_EXPORTING)
1074 # define PJ_DECL_DATA(type) PJ_EXPORT_DECL_SPECIFIER extern type
1076 # define PJ_DECL_DATA(type) PJ_IMPORT_DECL_SPECIFIER extern type
1078 #elif !defined(PJ_DECL_DATA)
1079 # define PJ_DECL_DATA(type) extern type
1088 #if defined(PJ_DLL) && defined(PJ_EXPORTING)
1089 # define PJ_DEF_DATA(type) PJ_EXPORT_DEF_SPECIFIER type
1090 #elif !defined(PJ_DEF_DATA)
1091 # define PJ_DEF_DATA(type) type
1106 #if PJ_FUNCTIONS_ARE_INLINED
1107 # define PJ_IDECL(type) PJ_INLINE(type)
1108 # define PJ_IDEF(type) PJ_INLINE(type)
1110 # define PJ_IDECL(type) PJ_DECL(type)
1111 # define PJ_IDEF(type) PJ_DEF(type)
1120 #define PJ_UNUSED_ARG(arg) (void)arg
1129 # define PJ_TODO(id) TODO___##id:
1137 # define PJ_RACE_ME(x)
1145 #define __pj_throw__(x)
1152 #ifndef PJ_HAS_HIGH_RES_TIMER
1153 # error "PJ_HAS_HIGH_RES_TIMER is not defined!"
1156 #if !defined(PJ_HAS_PENTIUM)
1157 # error "PJ_HAS_PENTIUM is not defined!"
1160 #if !defined(PJ_IS_LITTLE_ENDIAN)
1161 # error "PJ_IS_LITTLE_ENDIAN is not defined!"
1164 #if !defined(PJ_IS_BIG_ENDIAN)
1165 # error "PJ_IS_BIG_ENDIAN is not defined!"
1168 #if !defined(PJ_EMULATE_RWMUTEX)
1169 # error "PJ_EMULATE_RWMUTEX should be defined in compat/os_xx.h"
1172 #if !defined(PJ_THREAD_SET_STACK_SIZE)
1173 # error "PJ_THREAD_SET_STACK_SIZE should be defined in compat/os_xx.h"
1176 #if !defined(PJ_THREAD_ALLOCATE_STACK)
1177 # error "PJ_THREAD_ALLOCATE_STACK should be defined in compat/os_xx.h"
1183 #define PJ_VERSION_NUM_MAJOR 2
1186 #define PJ_VERSION_NUM_MINOR 1
1189 #define PJ_VERSION_NUM_REV 0
1195 #define PJ_VERSION_NUM_EXTRA ""
1202 #define PJ_VERSION_NUM ((PJ_VERSION_NUM_MAJOR << 24) | \
1203 (PJ_VERSION_NUM_MINOR << 16) | \
1204 (PJ_VERSION_NUM_REV << 8))
PJLIB Open Source, high performance, small footprint, and very very portable framework
Copyright (C) 2006-2009 Teluu Inc.
|