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
00023
00029
00030
00031
00032 #if defined(_MSC_VER)
00033 # include <pj/compat/cc_msvc.h>
00034 #elif defined(__GNUC__)
00035 # include <pj/compat/cc_gcc.h>
00036 #elif defined(__CW32__)
00037 # include <pj/compat/cc_mwcc.h>
00038 #elif defined(__MWERKS__)
00039 # include <pj/compat/cc_codew.h>
00040 #elif defined(__GCCE__)
00041 # include <pj/compat/cc_gcce.h>
00042 #elif defined(__ARMCC__)
00043 # include <pj/compat/cc_armcc.h>
00044 #else
00045 # error "Unknown compiler."
00046 #endif
00047
00048
00049 #ifndef PJ_ALIGN_DATA
00050 # error "PJ_ALIGN_DATA is not defined!"
00051 #endif
00052
00053
00054
00055
00056 #if defined(PJ_AUTOCONF)
00057
00058
00059
00060 # include <pj/compat/os_auto.h>
00061
00062 #elif defined(PJ_SYMBIAN) && PJ_SYMBIAN!=0
00063
00064
00065
00066 # include <pj/compat/os_symbian.h>
00067
00068 #elif defined(PJ_WIN32_WINCE) || defined(_WIN32_WCE) || defined(UNDER_CE)
00069
00070
00071
00072 # undef PJ_WIN32_WINCE
00073 # define PJ_WIN32_WINCE 1
00074 # include <pj/compat/os_win32_wince.h>
00075
00076
00077 # define PJ_WIN32 1
00078
00079 #elif defined(PJ_WIN32) || defined(_WIN32) || defined(__WIN32__) || \
00080 defined(_WIN64) || defined(WIN32) || defined(__TOS_WIN__)
00081
00082
00083
00084 # undef PJ_WIN32
00085 # define PJ_WIN32 1
00086 # include <pj/compat/os_win32.h>
00087
00088 #elif defined(PJ_LINUX_KERNEL) && PJ_LINUX_KERNEL!=0
00089
00090
00091
00092 # include <pj/compat/os_linux_kernel.h>
00093
00094 #elif defined(PJ_LINUX) || defined(linux) || defined(__linux)
00095
00096
00097
00098 # undef PJ_LINUX
00099 # define PJ_LINUX 1
00100 # include <pj/compat/os_linux.h>
00101
00102 #elif defined(PJ_PALMOS) && PJ_PALMOS!=0
00103
00104
00105
00106 # include <pj/compat/os_palmos.h>
00107
00108 #elif defined(PJ_SUNOS) || defined(sun) || defined(__sun)
00109
00110
00111
00112 # undef PJ_SUNOS
00113 # define PJ_SUNOS 1
00114 # include <pj/compat/os_sunos.h>
00115
00116 #elif defined(PJ_DARWINOS) || defined(__MACOSX__) || \
00117 defined (__APPLE__) || defined (__MACH__)
00118
00119
00120
00121 # undef PJ_DARWINOS
00122 # define PJ_DARWINOS 1
00123 # include <pj/compat/os_darwinos.h>
00124
00125 #elif defined(PJ_RTEMS) && PJ_RTEMS!=0
00126
00127
00128
00129 # include <pj/compat/os_rtems.h>
00130 #else
00131 # error "Please specify target os."
00132 #endif
00133
00134
00135
00136
00137
00138 #if defined(PJ_AUTOCONF)
00139
00140
00141
00142 #include <pj/compat/m_auto.h>
00143
00144 #elif defined (PJ_M_I386) || defined(_i386_) || defined(i_386_) || \
00145 defined(_X86_) || defined(x86) || defined(__i386__) || \
00146 defined(__i386) || defined(_M_IX86) || defined(__I86__)
00147
00148
00149
00150 # undef PJ_M_I386
00151 # define PJ_M_I386 1
00152 # define PJ_M_NAME "i386"
00153 # define PJ_HAS_PENTIUM 1
00154 # define PJ_IS_LITTLE_ENDIAN 1
00155 # define PJ_IS_BIG_ENDIAN 0
00156
00157
00158 #elif defined (PJ_M_X86_64) || defined(__amd64__) || defined(__amd64) || \
00159 defined(__x86_64__) || defined(__x86_64)
00160
00161
00162
00163 # undef PJ_M_X86_64
00164 # define PJ_M_X86_64 1
00165 # define PJ_M_NAME "x86_64"
00166 # define PJ_HAS_PENTIUM 1
00167 # define PJ_IS_LITTLE_ENDIAN 1
00168 # define PJ_IS_BIG_ENDIAN 0
00169
00170 #elif defined(PJ_M_IA64) || defined(__ia64__) || defined(_IA64) || \
00171 defined(__IA64__) || defined( _M_IA64)
00172
00173
00174
00175 # undef PJ_M_IA64
00176 # define PJ_M_IA64 1
00177 # define PJ_M_NAME "ia64"
00178 # define PJ_HAS_PENTIUM 1
00179 # define PJ_IS_LITTLE_ENDIAN 1
00180 # define PJ_IS_BIG_ENDIAN 0
00181
00182 #elif defined (PJ_M_M68K) && PJ_M_M68K != 0
00183
00184
00185
00186
00187 # undef PJ_M_M68K
00188 # define PJ_M_M68K 1
00189 # define PJ_M_NAME "m68k"
00190 # define PJ_HAS_PENTIUM 0
00191 # define PJ_IS_LITTLE_ENDIAN 0
00192 # define PJ_IS_BIG_ENDIAN 1
00193
00194
00195 #elif defined (PJ_M_ALPHA) || defined (__alpha__) || defined (__alpha) || \
00196 defined (_M_ALPHA)
00197
00198
00199
00200 # undef PJ_M_ALPHA
00201 # define PJ_M_ALPHA 1
00202 # define PJ_M_NAME "alpha"
00203 # define PJ_HAS_PENTIUM 0
00204 # define PJ_IS_LITTLE_ENDIAN 1
00205 # define PJ_IS_BIG_ENDIAN 0
00206
00207
00208 #elif defined(PJ_M_MIPS) || defined(__mips__) || defined(__mips) || \
00209 defined(__MIPS__) || defined(MIPS) || defined(_MIPS_)
00210
00211
00212
00213 # undef PJ_M_MIPS
00214 # define PJ_M_MIPS 1
00215 # define PJ_M_NAME "mips"
00216 # define PJ_HAS_PENTIUM 0
00217 # if !PJ_IS_LITTLE_ENDIAN && !PJ_IS_BIG_ENDIAN
00218 # error Endianness must be declared for this processor
00219 # endif
00220
00221
00222 #elif defined (PJ_M_SPARC) || defined( __sparc__) || defined(__sparc)
00223
00224
00225
00226 # undef PJ_M_SPARC
00227 # define PJ_M_SPARC 1
00228 # define PJ_M_NAME "sparc"
00229 # define PJ_HAS_PENTIUM 0
00230 # define PJ_IS_LITTLE_ENDIAN 0
00231 # define PJ_IS_BIG_ENDIAN 1
00232
00233 #elif defined (PJ_M_ARMV4) || defined(ARM) || defined(_ARM_) || \
00234 defined(ARMV4) || defined(__arm__)
00235
00236
00237
00238 # undef PJ_M_ARMV4
00239 # define PJ_M_ARMV4 1
00240 # define PJ_M_NAME "armv4"
00241 # define PJ_HAS_PENTIUM 0
00242 # if !PJ_IS_LITTLE_ENDIAN && !PJ_IS_BIG_ENDIAN
00243 # error Endianness must be declared for this processor
00244 # endif
00245
00246 #elif defined (PJ_M_POWERPC) || defined(__powerpc) || defined(__powerpc__) || \
00247 defined(__POWERPC__) || defined(__ppc__) || defined(_M_PPC) || \
00248 defined(_ARCH_PPC)
00249
00250
00251
00252 # undef PJ_M_POWERPC
00253 # define PJ_M_POWERPC 1
00254 # define PJ_M_NAME "powerpc"
00255 # define PJ_HAS_PENTIUM 0
00256 # if !PJ_IS_LITTLE_ENDIAN && !PJ_IS_BIG_ENDIAN
00257 # error Endianness must be declared for this processor
00258 # endif
00259
00260 #elif defined (PJ_M_NIOS2) || defined(__nios2) || defined(__nios2__) || \
00261 defined(__NIOS2__) || defined(__M_NIOS2) || defined(_ARCH_NIOS2)
00262
00263
00264
00265 # undef PJ_M_NIOS2
00266 # define PJ_M_NIOS2 1
00267 # define PJ_M_NAME "nios2"
00268 # define PJ_HAS_PENTIUM 0
00269 # define PJ_IS_LITTLE_ENDIAN 1
00270 # define PJ_IS_BIG_ENDIAN 0
00271
00272 #else
00273 # error "Please specify target machine."
00274 #endif
00275
00276
00277 #include <pj/compat/size_t.h>
00278
00279
00280
00281
00282 #include <pj/config_site.h>
00283
00284
00285
00286
00287
00288
00289 #ifdef DOXYGEN
00290 # undef PJ_FUNCTIONS_ARE_INLINED
00291 # undef PJ_HAS_FLOATING_POINT
00292 # undef PJ_LOG_MAX_LEVEL
00293 # undef PJ_LOG_MAX_SIZE
00294 # undef PJ_LOG_USE_STACK_BUFFER
00295 # undef PJ_TERM_HAS_COLOR
00296 # undef PJ_POOL_DEBUG
00297 # undef PJ_HAS_TCP
00298 # undef PJ_MAX_HOSTNAME
00299 # undef PJ_IOQUEUE_MAX_HANDLES
00300 # undef FD_SETSIZE
00301 # undef PJ_HAS_SEMAPHORE
00302 # undef PJ_HAS_EVENT_OBJ
00303 # undef PJ_ENABLE_EXTRA_CHECK
00304 # undef PJ_EXCEPTION_USE_WIN32_SEH
00305 # undef PJ_HAS_ERROR_STRING
00306
00307 # define PJ_HAS_IPV6 1
00308 #endif
00309
00327 #ifndef PJ_DEBUG
00328 # ifndef NDEBUG
00329 # define PJ_DEBUG 1
00330 # else
00331 # define PJ_DEBUG 0
00332 # endif
00333 #endif
00334
00343 #ifndef PJ_DEBUG_MUTEX
00344 # define PJ_DEBUG_MUTEX 0
00345 #endif
00346
00352 #ifndef PJ_FUNCTIONS_ARE_INLINED
00353 # define PJ_FUNCTIONS_ARE_INLINED 0
00354 #endif
00355
00361 #ifndef PJ_HAS_FLOATING_POINT
00362 # define PJ_HAS_FLOATING_POINT 1
00363 #endif
00364
00382 #ifndef PJ_LOG_MAX_LEVEL
00383 # define PJ_LOG_MAX_LEVEL 5
00384 #endif
00385
00394 #ifndef PJ_LOG_MAX_SIZE
00395 # define PJ_LOG_MAX_SIZE 4000
00396 #endif
00397
00406 #ifndef PJ_LOG_USE_STACK_BUFFER
00407 # define PJ_LOG_USE_STACK_BUFFER 1
00408 #endif
00409
00415 #ifndef PJ_LOG_ENABLE_INDENT
00416 # define PJ_LOG_ENABLE_INDENT 1
00417 #endif
00418
00425 #ifndef PJ_LOG_INDENT_SIZE
00426 # define PJ_LOG_INDENT_SIZE 1
00427 #endif
00428
00434 #ifndef PJ_LOG_INDENT_CHAR
00435 # define PJ_LOG_INDENT_CHAR '.'
00436 #endif
00437
00443 #ifndef PJ_TERM_HAS_COLOR
00444 # define PJ_TERM_HAS_COLOR 1
00445 #endif
00446
00447
00459 #ifndef PJ_SAFE_POOL
00460 # define PJ_SAFE_POOL 0
00461 #endif
00462
00463
00472 #ifndef PJ_POOL_DEBUG
00473 # define PJ_POOL_DEBUG 0
00474 #endif
00475
00476
00483 #ifndef PJ_THREAD_DEFAULT_STACK_SIZE
00484 # define PJ_THREAD_DEFAULT_STACK_SIZE 8192
00485 #endif
00486
00487
00495 #ifndef PJ_OS_HAS_CHECK_STACK
00496 # define PJ_OS_HAS_CHECK_STACK 0
00497 #endif
00498
00504 #ifndef PJ_HAS_POOL_ALT_API
00505 # define PJ_HAS_POOL_ALT_API PJ_POOL_DEBUG
00506 #endif
00507
00508
00515 #ifndef PJ_HAS_TCP
00516 # define PJ_HAS_TCP 1
00517 #endif
00518
00525 #ifndef PJ_HAS_IPV6
00526 # define PJ_HAS_IPV6 0
00527 #endif
00528
00536 #ifndef PJ_MAX_HOSTNAME
00537 # define PJ_MAX_HOSTNAME (128)
00538 #endif
00539
00546 #ifndef PJ_ACTIVESOCK_MAX_CONSECUTIVE_ACCEPT_ERROR
00547 # define PJ_ACTIVESOCK_MAX_CONSECUTIVE_ACCEPT_ERROR 50
00548 #endif
00549
00557 #ifndef PJ_IOQUEUE_MAX_HANDLES
00558 # define PJ_IOQUEUE_MAX_HANDLES (64)
00559 #endif
00560
00561
00578 #ifndef PJ_IOQUEUE_HAS_SAFE_UNREG
00579 # define PJ_IOQUEUE_HAS_SAFE_UNREG 1
00580 #endif
00581
00582
00594 #ifndef PJ_IOQUEUE_DEFAULT_ALLOW_CONCURRENCY
00595 # define PJ_IOQUEUE_DEFAULT_ALLOW_CONCURRENCY 1
00596 #endif
00597
00598
00599
00600
00601
00602
00603 #if (PJ_IOQUEUE_DEFAULT_ALLOW_CONCURRENCY==0) && (PJ_IOQUEUE_HAS_SAFE_UNREG==0)
00604 # error PJ_IOQUEUE_HAS_SAFE_UNREG must be enabled if ioqueue concurrency \
00605 is disabled
00606 #endif
00607
00608
00618 #ifndef PJ_IOQUEUE_KEY_FREE_DELAY
00619 # define PJ_IOQUEUE_KEY_FREE_DELAY 500
00620 #endif
00621
00622
00628 #ifndef PJ_FD_SETSIZE_SETABLE
00629 # if (defined(PJ_HAS_WINSOCK_H) && PJ_HAS_WINSOCK_H!=0) || \
00630 (defined(PJ_HAS_WINSOCK2_H) && PJ_HAS_WINSOCK2_H!=0)
00631 # define PJ_FD_SETSIZE_SETABLE 1
00632 # else
00633 # define PJ_FD_SETSIZE_SETABLE 0
00634 # endif
00635 #endif
00636
00643 #if PJ_FD_SETSIZE_SETABLE
00644
00645 # ifndef FD_SETSIZE
00646 # define FD_SETSIZE PJ_IOQUEUE_MAX_HANDLES
00647 # endif
00648 #else
00649
00650
00651
00652 # ifdef FD_SETSIZE
00653 # if PJ_IOQUEUE_MAX_HANDLES > FD_SETSIZE
00654 # error "PJ_IOQUEUE_MAX_HANDLES is greater than FD_SETSIZE"
00655 # endif
00656 # endif
00657 #endif
00658
00659
00666 #ifndef PJ_IP_HELPER_IGNORE_LOOPBACK_IF
00667 # define PJ_IP_HELPER_IGNORE_LOOPBACK_IF 1
00668 #endif
00669
00670
00676 #ifndef PJ_HAS_SEMAPHORE
00677 # define PJ_HAS_SEMAPHORE 1
00678 #endif
00679
00680
00686 #ifndef PJ_HAS_EVENT_OBJ
00687 # define PJ_HAS_EVENT_OBJ 1
00688 #endif
00689
00690
00694 #ifndef PJ_MAXPATH
00695 # define PJ_MAXPATH 260
00696 #endif
00697
00698
00710 #ifndef PJ_ENABLE_EXTRA_CHECK
00711 # define PJ_ENABLE_EXTRA_CHECK 1
00712 #endif
00713
00714
00726 #ifndef PJ_HAS_EXCEPTION_NAMES
00727 # define PJ_HAS_EXCEPTION_NAMES 1
00728 #endif
00729
00737 #ifndef PJ_MAX_EXCEPTION_ID
00738 # define PJ_MAX_EXCEPTION_ID 16
00739 #endif
00740
00747 #ifndef PJ_EXCEPTION_USE_WIN32_SEH
00748 # define PJ_EXCEPTION_USE_WIN32_SEH 0
00749 #endif
00750
00757 #ifndef PJ_TIMESTAMP_USE_RDTSC
00758 # define PJ_TIMESTAMP_USE_RDTSC 0
00759 #endif
00760
00765 #ifndef PJ_NATIVE_ERR_POSITIVE
00766 # define PJ_NATIVE_ERR_POSITIVE 1
00767 #endif
00768
00775 #ifndef PJ_HAS_ERROR_STRING
00776 # define PJ_HAS_ERROR_STRING 1
00777 #endif
00778
00779
00788 #ifndef PJ_HAS_STRICMP_ALNUM
00789 # define PJ_HAS_STRICMP_ALNUM 0
00790 #endif
00791
00792
00793
00794
00795
00796
00801 #define PJ_QOS_DUMMY 1
00802
00804 #define PJ_QOS_BSD 2
00805
00807 #define PJ_QOS_WM 3
00808
00810 #define PJ_QOS_SYMBIAN 4
00811
00815 #ifndef PJ_QOS_IMPLEMENTATION
00816 # if defined(PJ_WIN32_WINCE) && PJ_WIN32_WINCE && _WIN32_WCE >= 0x502
00817
00818 # define PJ_QOS_IMPLEMENTATION PJ_QOS_WM
00819 # endif
00820 #endif
00821
00822
00830 #ifndef PJ_HAS_SSL_SOCK
00831 # define PJ_HAS_SSL_SOCK 0
00832 #endif
00833
00834
00841 #ifndef PJ_SOCK_DISABLE_WSAECONNRESET
00842 # define PJ_SOCK_DISABLE_WSAECONNRESET 1
00843 #endif
00844
00845
00848
00849
00850
00851
00934 #define PJ_INLINE(type) PJ_INLINE_SPECIFIER type
00935
00944 #ifndef PJ_EXPORT_DECL_SPECIFIER
00945 # define PJ_EXPORT_DECL_SPECIFIER
00946 #endif
00947
00948
00957 #ifndef PJ_EXPORT_DEF_SPECIFIER
00958 # define PJ_EXPORT_DEF_SPECIFIER
00959 #endif
00960
00961
00969 #ifndef PJ_IMPORT_DECL_SPECIFIER
00970 # define PJ_IMPORT_DECL_SPECIFIER
00971 #endif
00972
00973
00977 #ifndef PJ_EXPORT_SYMBOL
00978 # define PJ_EXPORT_SYMBOL(x)
00979 #endif
00980
00981
00987 #if defined(PJ_DLL)
00988 # if defined(PJ_EXPORTING)
00989 # define PJ_DECL(type) PJ_EXPORT_DECL_SPECIFIER type
00990 # else
00991 # define PJ_DECL(type) PJ_IMPORT_DECL_SPECIFIER type
00992 # endif
00993 #elif !defined(PJ_DECL)
00994 # if defined(__cplusplus)
00995 # define PJ_DECL(type) type
00996 # else
00997 # define PJ_DECL(type) extern type
00998 # endif
00999 #endif
01000
01001
01007 #if defined(PJ_DLL) && defined(PJ_EXPORTING)
01008 # define PJ_DEF(type) PJ_EXPORT_DEF_SPECIFIER type
01009 #elif !defined(PJ_DEF)
01010 # define PJ_DEF(type) type
01011 #endif
01012
01013
01032 #ifdef __cplusplus
01033 # define PJ_DECL_NO_RETURN(type) PJ_DECL(type) PJ_NORETURN
01034 # define PJ_IDECL_NO_RETURN(type) PJ_INLINE(type) PJ_NORETURN
01035 # define PJ_BEGIN_DECL extern "C" {
01036 # define PJ_END_DECL }
01037 #else
01038 # define PJ_DECL_NO_RETURN(type) PJ_NORETURN PJ_DECL(type)
01039 # define PJ_IDECL_NO_RETURN(type) PJ_NORETURN PJ_INLINE(type)
01040 # define PJ_BEGIN_DECL
01041 # define PJ_END_DECL
01042 #endif
01043
01044
01045
01051 #if defined(PJ_DLL)
01052 # if defined(PJ_EXPORTING)
01053 # define PJ_DECL_DATA(type) PJ_EXPORT_DECL_SPECIFIER extern type
01054 # else
01055 # define PJ_DECL_DATA(type) PJ_IMPORT_DECL_SPECIFIER extern type
01056 # endif
01057 #elif !defined(PJ_DECL_DATA)
01058 # define PJ_DECL_DATA(type) extern type
01059 #endif
01060
01061
01067 #if defined(PJ_DLL) && defined(PJ_EXPORTING)
01068 # define PJ_DEF_DATA(type) PJ_EXPORT_DEF_SPECIFIER type
01069 #elif !defined(PJ_DEF_DATA)
01070 # define PJ_DEF_DATA(type) type
01071 #endif
01072
01073
01085 #if PJ_FUNCTIONS_ARE_INLINED
01086 # define PJ_IDECL(type) PJ_INLINE(type)
01087 # define PJ_IDEF(type) PJ_INLINE(type)
01088 #else
01089 # define PJ_IDECL(type) PJ_DECL(type)
01090 # define PJ_IDEF(type) PJ_DEF(type)
01091 #endif
01092
01093
01099 #define PJ_UNUSED_ARG(arg) (void)arg
01100
01107 #ifndef PJ_TODO
01108 # define PJ_TODO(id) TODO___##id:
01109 #endif
01110
01116 #define __pj_throw__(x)
01117
01120
01121
01122
01123 #ifndef PJ_HAS_HIGH_RES_TIMER
01124 # error "PJ_HAS_HIGH_RES_TIMER is not defined!"
01125 #endif
01126
01127 #if !defined(PJ_HAS_PENTIUM)
01128 # error "PJ_HAS_PENTIUM is not defined!"
01129 #endif
01130
01131 #if !defined(PJ_IS_LITTLE_ENDIAN)
01132 # error "PJ_IS_LITTLE_ENDIAN is not defined!"
01133 #endif
01134
01135 #if !defined(PJ_IS_BIG_ENDIAN)
01136 # error "PJ_IS_BIG_ENDIAN is not defined!"
01137 #endif
01138
01139 #if !defined(PJ_EMULATE_RWMUTEX)
01140 # error "PJ_EMULATE_RWMUTEX should be defined in compat/os_xx.h"
01141 #endif
01142
01143 #if !defined(PJ_THREAD_SET_STACK_SIZE)
01144 # error "PJ_THREAD_SET_STACK_SIZE should be defined in compat/os_xx.h"
01145 #endif
01146
01147 #if !defined(PJ_THREAD_ALLOCATE_STACK)
01148 # error "PJ_THREAD_ALLOCATE_STACK should be defined in compat/os_xx.h"
01149 #endif
01150
01151 PJ_BEGIN_DECL
01152
01154 #define PJ_VERSION_NUM_MAJOR 2
01155
01157 #define PJ_VERSION_NUM_MINOR 0
01158
01160 #define PJ_VERSION_NUM_REV 0
01161
01166 #define PJ_VERSION_NUM_EXTRA ""
01167
01173 #define PJ_VERSION_NUM ((PJ_VERSION_NUM_MAJOR << 24) | \
01174 (PJ_VERSION_NUM_MINOR << 16) | \
01175 (PJ_VERSION_NUM_REV << 8))
01176
01180 PJ_DECL_DATA(const char*) PJ_VERSION;
01181
01187 PJ_DECL(const char*) pj_get_version(void);
01188
01192 PJ_DECL(void) pj_dump_config(void);
01193
01194 PJ_END_DECL
01195
01196
01197 #endif
01198