Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef __PJ_CONFIG_H__
00021 #define __PJ_CONFIG_H__
00022
00028
00029
00030
00031 #if defined(_MSC_VER)
00032 # include <pj/compat/cc_msvc.h>
00033 #elif defined(__GNUC__)
00034 # include <pj/compat/cc_gcc.h>
00035 #elif defined(__CW32__)
00036 # include <pj/compat/cc_mwcc.h>
00037 #elif defined(__MWERKS__)
00038 # include <pj/compat/cc_codew.h>
00039 #elif defined(__GCCE__)
00040 # include <pj/compat/cc_gcce.h>
00041 #elif defined(__ARMCC__)
00042 # include <pj/compat/cc_armcc.h>
00043 #else
00044 # error "Unknown compiler."
00045 #endif
00046
00047
00048
00049
00050
00051 #if defined(PJ_AUTOCONF)
00052
00053
00054
00055 # include <pj/compat/os_auto.h>
00056
00057 #elif defined(PJ_SYMBIAN) && PJ_SYMBIAN!=0
00058
00059
00060
00061 # include <pj/compat/os_symbian.h>
00062
00063 #elif defined(PJ_WIN32_WINCE) || defined(_WIN32_WCE) || defined(UNDER_CE)
00064
00065
00066
00067 # undef PJ_WIN32_WINCE
00068 # define PJ_WIN32_WINCE 1
00069 # include <pj/compat/os_win32_wince.h>
00070
00071
00072 # define PJ_WIN32 1
00073
00074 #elif defined(PJ_WIN32) || defined(_WIN32) || defined(__WIN32__) || \
00075 defined(_WIN64) || defined(WIN32) || defined(__TOS_WIN__)
00076
00077
00078
00079 # undef PJ_WIN32
00080 # define PJ_WIN32 1
00081 # include <pj/compat/os_win32.h>
00082
00083 #elif defined(PJ_LINUX_KERNEL) && PJ_LINUX_KERNEL!=0
00084
00085
00086
00087 # include <pj/compat/os_linux_kernel.h>
00088
00089 #elif defined(PJ_LINUX) || defined(linux) || defined(__linux)
00090
00091
00092
00093 # undef PJ_LINUX
00094 # define PJ_LINUX 1
00095 # include <pj/compat/os_linux.h>
00096
00097 #elif defined(PJ_PALMOS) && PJ_PALMOS!=0
00098
00099
00100
00101 # include <pj/compat/os_palmos.h>
00102
00103 #elif defined(PJ_SUNOS) || defined(sun) || defined(__sun)
00104
00105
00106
00107 # undef PJ_SUNOS
00108 # define PJ_SUNOS 1
00109 # include <pj/compat/os_sunos.h>
00110
00111 #elif defined(PJ_DARWINOS) || defined(__MACOSX__) || \
00112 defined (__APPLE__) || defined (__MACH__)
00113
00114
00115
00116 # undef PJ_DARWINOS
00117 # define PJ_DARWINOS 1
00118 # include <pj/compat/os_darwinos.h>
00119
00120 #elif defined(PJ_RTEMS) && PJ_RTEMS!=0
00121
00122
00123
00124 # include <pj/compat/os_rtems.h>
00125 #else
00126 # error "Please specify target os."
00127 #endif
00128
00129
00130
00131
00132
00133 #if defined(PJ_AUTOCONF)
00134
00135
00136
00137 #include <pj/compat/m_auto.h>
00138
00139 #elif defined (PJ_M_I386) || defined(_i386_) || defined(i_386_) || \
00140 defined(_X86_) || defined(x86) || defined(__i386__) || \
00141 defined(__i386) || defined(_M_IX86) || defined(__I86__)
00142
00143
00144
00145 # undef PJ_M_I386
00146 # define PJ_M_I386 1
00147 # define PJ_M_NAME "i386"
00148 # define PJ_HAS_PENTIUM 1
00149 # define PJ_IS_LITTLE_ENDIAN 1
00150 # define PJ_IS_BIG_ENDIAN 0
00151
00152
00153 #elif defined (PJ_M_X86_64) || defined(__amd64__) || defined(__amd64) || \
00154 defined(__x86_64__) || defined(__x86_64)
00155
00156
00157
00158 # undef PJ_M_X86_64
00159 # define PJ_M_X86_64 1
00160 # define PJ_M_NAME "x86_64"
00161 # define PJ_HAS_PENTIUM 1
00162 # define PJ_IS_LITTLE_ENDIAN 1
00163 # define PJ_IS_BIG_ENDIAN 0
00164
00165 #elif defined(PJ_M_IA64) || defined(__ia64__) || defined(_IA64) || \
00166 defined(__IA64__) || defined( _M_IA64)
00167
00168
00169
00170 # undef PJ_M_IA64
00171 # define PJ_M_IA64 1
00172 # define PJ_M_NAME "ia64"
00173 # define PJ_HAS_PENTIUM 1
00174 # define PJ_IS_LITTLE_ENDIAN 1
00175 # define PJ_IS_BIG_ENDIAN 0
00176
00177 #elif defined (PJ_M_M68K) && PJ_M_M68K != 0
00178
00179
00180
00181
00182 # undef PJ_M_M68K
00183 # define PJ_M_M68K 1
00184 # define PJ_M_NAME "m68k"
00185 # define PJ_HAS_PENTIUM 0
00186 # define PJ_IS_LITTLE_ENDIAN 0
00187 # define PJ_IS_BIG_ENDIAN 1
00188
00189
00190 #elif defined (PJ_M_ALPHA) || defined (__alpha__) || defined (__alpha) || \
00191 defined (_M_ALPHA)
00192
00193
00194
00195 # undef PJ_M_ALPHA
00196 # define PJ_M_ALPHA 1
00197 # define PJ_M_NAME "alpha"
00198 # define PJ_HAS_PENTIUM 0
00199 # define PJ_IS_LITTLE_ENDIAN 1
00200 # define PJ_IS_BIG_ENDIAN 0
00201
00202
00203 #elif defined(PJ_M_MIPS) || defined(__mips__) || defined(__mips) || \
00204 defined(__MIPS__) || defined(MIPS) || defined(_MIPS_)
00205
00206
00207
00208 # undef PJ_M_MIPS
00209 # define PJ_M_MIPS 1
00210 # define PJ_M_NAME "mips"
00211 # define PJ_HAS_PENTIUM 0
00212 # if !PJ_IS_LITTLE_ENDIAN && !PJ_IS_BIG_ENDIAN
00213 # error Endianness must be declared for this processor
00214 # endif
00215
00216
00217 #elif defined (PJ_M_SPARC) || defined( __sparc__) || defined(__sparc)
00218
00219
00220
00221 # undef PJ_M_SPARC
00222 # define PJ_M_SPARC 1
00223 # define PJ_M_NAME "sparc"
00224 # define PJ_HAS_PENTIUM 0
00225 # define PJ_IS_LITTLE_ENDIAN 0
00226 # define PJ_IS_BIG_ENDIAN 1
00227
00228 #elif defined (PJ_M_ARMV4) || defined(ARM) || defined(_ARM_) || \
00229 defined(ARMV4) || defined(__arm__)
00230
00231
00232
00233 # undef PJ_M_ARMV4
00234 # define PJ_M_ARMV4 1
00235 # define PJ_M_NAME "armv4"
00236 # define PJ_HAS_PENTIUM 0
00237 # if !PJ_IS_LITTLE_ENDIAN && !PJ_IS_BIG_ENDIAN
00238 # error Endianness must be declared for this processor
00239 # endif
00240
00241 #elif defined (PJ_M_POWERPC) || defined(__powerpc) || defined(__powerpc__) || \
00242 defined(__POWERPC__) || defined(__ppc__) || defined(_M_PPC) || \
00243 defined(_ARCH_PPC)
00244
00245
00246
00247 # undef PJ_M_POWERPC
00248 # define PJ_M_POWERPC 1
00249 # define PJ_M_NAME "powerpc"
00250 # define PJ_HAS_PENTIUM 0
00251 # if !PJ_IS_LITTLE_ENDIAN && !PJ_IS_BIG_ENDIAN
00252 # error Endianness must be declared for this processor
00253 # endif
00254
00255 #elif defined (PJ_M_NIOS2) || defined(__nios2) || defined(__nios2__) || \
00256 defined(__NIOS2__) || defined(__M_NIOS2) || defined(_ARCH_NIOS2)
00257
00258
00259
00260 # undef PJ_M_NIOS2
00261 # define PJ_M_NIOS2 1
00262 # define PJ_M_NAME "nios2"
00263 # define PJ_HAS_PENTIUM 0
00264 # define PJ_IS_LITTLE_ENDIAN 1
00265 # define PJ_IS_BIG_ENDIAN 0
00266
00267 #else
00268 # error "Please specify target machine."
00269 #endif
00270
00271
00272 #include <pj/compat/size_t.h>
00273
00274
00275
00276
00277 #include <pj/config_site.h>
00278
00279
00280
00281
00282
00283
00284 #ifdef DOXYGEN
00285 # undef PJ_FUNCTIONS_ARE_INLINED
00286 # undef PJ_HAS_FLOATING_POINT
00287 # undef PJ_LOG_MAX_LEVEL
00288 # undef PJ_LOG_MAX_SIZE
00289 # undef PJ_LOG_USE_STACK_BUFFER
00290 # undef PJ_TERM_HAS_COLOR
00291 # undef PJ_POOL_DEBUG
00292 # undef PJ_HAS_TCP
00293 # undef PJ_MAX_HOSTNAME
00294 # undef PJ_IOQUEUE_MAX_HANDLES
00295 # undef FD_SETSIZE
00296 # undef PJ_HAS_SEMAPHORE
00297 # undef PJ_HAS_EVENT_OBJ
00298 # undef PJ_ENABLE_EXTRA_CHECK
00299 # undef PJ_EXCEPTION_USE_WIN32_SEH
00300 # undef PJ_HAS_ERROR_STRING
00301
00302 # define PJ_HAS_IPV6 1
00303 #endif
00304
00322 #ifndef PJ_DEBUG
00323 # ifndef NDEBUG
00324 # define PJ_DEBUG 1
00325 # else
00326 # define PJ_DEBUG 0
00327 # endif
00328 #endif
00329
00338 #ifndef PJ_DEBUG_MUTEX
00339 # define PJ_DEBUG_MUTEX 0
00340 #endif
00341
00347 #ifndef PJ_FUNCTIONS_ARE_INLINED
00348 # define PJ_FUNCTIONS_ARE_INLINED 0
00349 #endif
00350
00356 #ifndef PJ_HAS_FLOATING_POINT
00357 # define PJ_HAS_FLOATING_POINT 1
00358 #endif
00359
00377 #ifndef PJ_LOG_MAX_LEVEL
00378 # define PJ_LOG_MAX_LEVEL 5
00379 #endif
00380
00389 #ifndef PJ_LOG_MAX_SIZE
00390 # define PJ_LOG_MAX_SIZE 4000
00391 #endif
00392
00401 #ifndef PJ_LOG_USE_STACK_BUFFER
00402 # define PJ_LOG_USE_STACK_BUFFER 1
00403 #endif
00404
00405
00411 #ifndef PJ_TERM_HAS_COLOR
00412 # define PJ_TERM_HAS_COLOR 1
00413 #endif
00414
00415
00427 #ifndef PJ_SAFE_POOL
00428 # define PJ_SAFE_POOL 0
00429 #endif
00430
00431
00440 #ifndef PJ_POOL_DEBUG
00441 # define PJ_POOL_DEBUG 0
00442 #endif
00443
00444
00451 #ifndef PJ_THREAD_DEFAULT_STACK_SIZE
00452 # define PJ_THREAD_DEFAULT_STACK_SIZE 8192
00453 #endif
00454
00455
00463 #ifndef PJ_OS_HAS_CHECK_STACK
00464 # define PJ_OS_HAS_CHECK_STACK 0
00465 #endif
00466
00472 #ifndef PJ_HAS_POOL_ALT_API
00473 # define PJ_HAS_POOL_ALT_API PJ_POOL_DEBUG
00474 #endif
00475
00476
00483 #ifndef PJ_HAS_TCP
00484 # define PJ_HAS_TCP 1
00485 #endif
00486
00493 #ifndef PJ_HAS_IPV6
00494 # define PJ_HAS_IPV6 0
00495 #endif
00496
00504 #ifndef PJ_MAX_HOSTNAME
00505 # define PJ_MAX_HOSTNAME (128)
00506 #endif
00507
00514 #ifndef PJ_ACTIVESOCK_MAX_CONSECUTIVE_ACCEPT_ERROR
00515 # define PJ_ACTIVESOCK_MAX_CONSECUTIVE_ACCEPT_ERROR 50
00516 #endif
00517
00525 #ifndef PJ_IOQUEUE_MAX_HANDLES
00526 # define PJ_IOQUEUE_MAX_HANDLES (64)
00527 #endif
00528
00529
00546 #ifndef PJ_IOQUEUE_HAS_SAFE_UNREG
00547 # define PJ_IOQUEUE_HAS_SAFE_UNREG 1
00548 #endif
00549
00550
00562 #ifndef PJ_IOQUEUE_DEFAULT_ALLOW_CONCURRENCY
00563 # define PJ_IOQUEUE_DEFAULT_ALLOW_CONCURRENCY 1
00564 #endif
00565
00566
00567
00568
00569
00570
00571 #if (PJ_IOQUEUE_DEFAULT_ALLOW_CONCURRENCY==0) && (PJ_IOQUEUE_HAS_SAFE_UNREG==0)
00572 # error PJ_IOQUEUE_HAS_SAFE_UNREG must be enabled if ioqueue concurrency \
00573 is disabled
00574 #endif
00575
00576
00586 #ifndef PJ_IOQUEUE_KEY_FREE_DELAY
00587 # define PJ_IOQUEUE_KEY_FREE_DELAY 500
00588 #endif
00589
00590
00596 #ifndef PJ_FD_SETSIZE_SETABLE
00597 # if (defined(PJ_HAS_WINSOCK_H) && PJ_HAS_WINSOCK_H!=0) || \
00598 (defined(PJ_HAS_WINSOCK2_H) && PJ_HAS_WINSOCK2_H!=0)
00599 # define PJ_FD_SETSIZE_SETABLE 1
00600 # else
00601 # define PJ_FD_SETSIZE_SETABLE 0
00602 # endif
00603 #endif
00604
00611 #if PJ_FD_SETSIZE_SETABLE
00612
00613 # ifndef FD_SETSIZE
00614 # define FD_SETSIZE PJ_IOQUEUE_MAX_HANDLES
00615 # endif
00616 #else
00617
00618
00619
00620 # ifdef FD_SETSIZE
00621 # if PJ_IOQUEUE_MAX_HANDLES > FD_SETSIZE
00622 # error "PJ_IOQUEUE_MAX_HANDLES is greater than FD_SETSIZE"
00623 # endif
00624 # endif
00625 #endif
00626
00627
00634 #ifndef PJ_IP_HELPER_IGNORE_LOOPBACK_IF
00635 # define PJ_IP_HELPER_IGNORE_LOOPBACK_IF 1
00636 #endif
00637
00638
00644 #ifndef PJ_HAS_SEMAPHORE
00645 # define PJ_HAS_SEMAPHORE 1
00646 #endif
00647
00648
00654 #ifndef PJ_HAS_EVENT_OBJ
00655 # define PJ_HAS_EVENT_OBJ 1
00656 #endif
00657
00658
00662 #ifndef PJ_MAXPATH
00663 # define PJ_MAXPATH 260
00664 #endif
00665
00666
00678 #ifndef PJ_ENABLE_EXTRA_CHECK
00679 # define PJ_ENABLE_EXTRA_CHECK 1
00680 #endif
00681
00682
00694 #ifndef PJ_HAS_EXCEPTION_NAMES
00695 # define PJ_HAS_EXCEPTION_NAMES 1
00696 #endif
00697
00705 #ifndef PJ_MAX_EXCEPTION_ID
00706 # define PJ_MAX_EXCEPTION_ID 16
00707 #endif
00708
00715 #ifndef PJ_EXCEPTION_USE_WIN32_SEH
00716 # define PJ_EXCEPTION_USE_WIN32_SEH 0
00717 #endif
00718
00725 #ifndef PJ_TIMESTAMP_USE_RDTSC
00726 # define PJ_TIMESTAMP_USE_RDTSC 0
00727 #endif
00728
00733 #ifndef PJ_NATIVE_ERR_POSITIVE
00734 # define PJ_NATIVE_ERR_POSITIVE 1
00735 #endif
00736
00743 #ifndef PJ_HAS_ERROR_STRING
00744 # define PJ_HAS_ERROR_STRING 1
00745 #endif
00746
00747
00756 #ifndef PJ_HAS_STRICMP_ALNUM
00757 # define PJ_HAS_STRICMP_ALNUM 0
00758 #endif
00759
00760
00761
00762
00763
00764
00769 #define PJ_QOS_DUMMY 1
00770
00772 #define PJ_QOS_BSD 2
00773
00775 #define PJ_QOS_WM 3
00776
00778 #define PJ_QOS_SYMBIAN 4
00779
00783 #ifndef PJ_QOS_IMPLEMENTATION
00784 # if defined(PJ_WIN32_WINCE) && PJ_WIN32_WINCE && _WIN32_WCE >= 0x502
00785
00786 # define PJ_QOS_IMPLEMENTATION PJ_QOS_WM
00787 # endif
00788 #endif
00789
00790
00798 #ifndef PJ_HAS_SSL_SOCK
00799 # define PJ_HAS_SSL_SOCK 0
00800 #endif
00801
00802
00809 #ifndef PJ_SOCK_DISABLE_WSAECONNRESET
00810 # define PJ_SOCK_DISABLE_WSAECONNRESET 1
00811 #endif
00812
00813
00816
00817
00818
00819
00902 #define PJ_INLINE(type) PJ_INLINE_SPECIFIER type
00903
00912 #ifndef PJ_EXPORT_DECL_SPECIFIER
00913 # define PJ_EXPORT_DECL_SPECIFIER
00914 #endif
00915
00916
00925 #ifndef PJ_EXPORT_DEF_SPECIFIER
00926 # define PJ_EXPORT_DEF_SPECIFIER
00927 #endif
00928
00929
00937 #ifndef PJ_IMPORT_DECL_SPECIFIER
00938 # define PJ_IMPORT_DECL_SPECIFIER
00939 #endif
00940
00941
00945 #ifndef PJ_EXPORT_SYMBOL
00946 # define PJ_EXPORT_SYMBOL(x)
00947 #endif
00948
00949
00955 #if defined(PJ_DLL)
00956 # if defined(PJ_EXPORTING)
00957 # define PJ_DECL(type) PJ_EXPORT_DECL_SPECIFIER type
00958 # else
00959 # define PJ_DECL(type) PJ_IMPORT_DECL_SPECIFIER type
00960 # endif
00961 #elif !defined(PJ_DECL)
00962 # if defined(__cplusplus)
00963 # define PJ_DECL(type) type
00964 # else
00965 # define PJ_DECL(type) extern type
00966 # endif
00967 #endif
00968
00969
00975 #if defined(PJ_DLL) && defined(PJ_EXPORTING)
00976 # define PJ_DEF(type) PJ_EXPORT_DEF_SPECIFIER type
00977 #elif !defined(PJ_DEF)
00978 # define PJ_DEF(type) type
00979 #endif
00980
00981
01000 #ifdef __cplusplus
01001 # define PJ_DECL_NO_RETURN(type) PJ_DECL(type) PJ_NORETURN
01002 # define PJ_IDECL_NO_RETURN(type) PJ_INLINE(type) PJ_NORETURN
01003 # define PJ_BEGIN_DECL extern "C" {
01004 # define PJ_END_DECL }
01005 #else
01006 # define PJ_DECL_NO_RETURN(type) PJ_NORETURN PJ_DECL(type)
01007 # define PJ_IDECL_NO_RETURN(type) PJ_NORETURN PJ_INLINE(type)
01008 # define PJ_BEGIN_DECL
01009 # define PJ_END_DECL
01010 #endif
01011
01012
01013
01019 #if defined(PJ_DLL)
01020 # if defined(PJ_EXPORTING)
01021 # define PJ_DECL_DATA(type) PJ_EXPORT_DECL_SPECIFIER extern type
01022 # else
01023 # define PJ_DECL_DATA(type) PJ_IMPORT_DECL_SPECIFIER extern type
01024 # endif
01025 #elif !defined(PJ_DECL_DATA)
01026 # define PJ_DECL_DATA(type) extern type
01027 #endif
01028
01029
01035 #if defined(PJ_DLL) && defined(PJ_EXPORTING)
01036 # define PJ_DEF_DATA(type) PJ_EXPORT_DEF_SPECIFIER type
01037 #elif !defined(PJ_DEF_DATA)
01038 # define PJ_DEF_DATA(type) type
01039 #endif
01040
01041
01053 #if PJ_FUNCTIONS_ARE_INLINED
01054 # define PJ_IDECL(type) PJ_INLINE(type)
01055 # define PJ_IDEF(type) PJ_INLINE(type)
01056 #else
01057 # define PJ_IDECL(type) PJ_DECL(type)
01058 # define PJ_IDEF(type) PJ_DEF(type)
01059 #endif
01060
01061
01067 #define PJ_UNUSED_ARG(arg) (void)arg
01068
01075 #ifndef PJ_TODO
01076 # define PJ_TODO(id) TODO___##id:
01077 #endif
01078
01084 #define __pj_throw__(x)
01085
01088
01089
01090
01091 #ifndef PJ_HAS_HIGH_RES_TIMER
01092 # error "PJ_HAS_HIGH_RES_TIMER is not defined!"
01093 #endif
01094
01095 #if !defined(PJ_HAS_PENTIUM)
01096 # error "PJ_HAS_PENTIUM is not defined!"
01097 #endif
01098
01099 #if !defined(PJ_IS_LITTLE_ENDIAN)
01100 # error "PJ_IS_LITTLE_ENDIAN is not defined!"
01101 #endif
01102
01103 #if !defined(PJ_IS_BIG_ENDIAN)
01104 # error "PJ_IS_BIG_ENDIAN is not defined!"
01105 #endif
01106
01107 #if !defined(PJ_EMULATE_RWMUTEX)
01108 # error "PJ_EMULATE_RWMUTEX should be defined in compat/os_xx.h"
01109 #endif
01110
01111 #if !defined(PJ_THREAD_SET_STACK_SIZE)
01112 # error "PJ_THREAD_SET_STACK_SIZE should be defined in compat/os_xx.h"
01113 #endif
01114
01115 #if !defined(PJ_THREAD_ALLOCATE_STACK)
01116 # error "PJ_THREAD_ALLOCATE_STACK should be defined in compat/os_xx.h"
01117 #endif
01118
01119 PJ_BEGIN_DECL
01120
01122 #define PJ_VERSION_NUM_MAJOR 1
01123
01125 #define PJ_VERSION_NUM_MINOR 16
01126
01128 #define PJ_VERSION_NUM_REV 0
01129
01134 #define PJ_VERSION_NUM_EXTRA ""
01135
01141 #define PJ_VERSION_NUM ((PJ_VERSION_NUM_MAJOR << 24) | \
01142 (PJ_VERSION_NUM_MINOR << 16) | \
01143 (PJ_VERSION_NUM_REV << 8))
01144
01148 PJ_DECL_DATA(const char*) PJ_VERSION;
01149
01155 PJ_DECL(const char*) pj_get_version(void);
01156
01160 PJ_DECL(void) pj_dump_config(void);
01161
01162 PJ_END_DECL
01163
01164
01165 #endif
01166