BLOG | DOCUMENTATION | GITHUB

Home --> Documentations --> PJLIB Reference

config.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com)
3 * Copyright (C) 2003-2008 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_CONFIG_H__
20#define __PJ_CONFIG_H__
21
22
28/********************************************************************
29 * Include compiler specific configuration.
30 */
31#if defined(_MSC_VER)
32# include <pj/compat/cc_msvc.h>
33#elif defined(__GNUC__)
34# include <pj/compat/cc_gcc.h>
35#elif defined(__CW32__)
36# include <pj/compat/cc_mwcc.h>
37#elif defined(__MWERKS__)
38# include <pj/compat/cc_codew.h>
39#elif defined(__GCCE__)
40# include <pj/compat/cc_gcce.h>
41#elif defined(__ARMCC__)
42# include <pj/compat/cc_armcc.h>
43#else
44# error "Unknown compiler."
45#endif
46
47/* PJ_ALIGN_DATA is compiler specific directive to align data address */
48#ifndef PJ_ALIGN_DATA
49# error "PJ_ALIGN_DATA is not defined!"
50#endif
51
52/********************************************************************
53 * Include target OS specific configuration.
54 */
55#if defined(PJ_AUTOCONF)
56 /*
57 * Autoconf
58 */
59# include <pj/compat/os_auto.h>
60
61#elif defined(PJ_SYMBIAN) && PJ_SYMBIAN!=0
62 /*
63 * SymbianOS
64 */
65# include <pj/compat/os_symbian.h>
66
67#elif defined(PJ_WIN32_WINCE) || defined(_WIN32_WCE) || defined(UNDER_CE)
68 /*
69 * Windows CE
70 */
71# undef PJ_WIN32_WINCE
72# define PJ_WIN32_WINCE 1
73# include <pj/compat/os_win32_wince.h>
74
75 /* Also define Win32 */
76# define PJ_WIN32 1
77
78#elif defined(PJ_WIN32_WINPHONE8) || defined(_WIN32_WINPHONE8)
79 /*
80 * Windows Phone 8
81 */
82# undef PJ_WIN32_WINPHONE8
83# define PJ_WIN32_WINPHONE8 1
84# include <pj/compat/os_winphone8.h>
85
86 /* Also define Win32 */
87# define PJ_WIN32 1
88
89#elif defined(PJ_WIN32_UWP) || defined(_WIN32_UWP)
90 /*
91 * Windows UWP
92 */
93# undef PJ_WIN32_UWP
94# define PJ_WIN32_UWP 1
95# include <pj/compat/os_winuwp.h>
96
97 /* Define Windows phone */
98# define PJ_WIN32_WINPHONE8 1
99
100 /* Also define Win32 */
101# define PJ_WIN32 1
102
103#elif defined(PJ_WIN32) || defined(_WIN32) || defined(__WIN32__) || \
104 defined(WIN32) || defined(PJ_WIN64) || defined(_WIN64) || \
105 defined(WIN64) || defined(__TOS_WIN__)
106# if defined(PJ_WIN64) || defined(_WIN64) || defined(WIN64)
107 /*
108 * Win64
109 */
110# undef PJ_WIN64
111# define PJ_WIN64 1
112# endif
113# undef PJ_WIN32
114# define PJ_WIN32 1
115# include <pj/compat/os_win32.h>
116
117#elif defined(PJ_LINUX) || defined(linux) || defined(__linux)
118 /*
119 * Linux
120 */
121# undef PJ_LINUX
122# define PJ_LINUX 1
123# include <pj/compat/os_linux.h>
124
125#elif defined(PJ_PALMOS) && PJ_PALMOS!=0
126 /*
127 * Palm
128 */
129# include <pj/compat/os_palmos.h>
130
131#elif defined(PJ_SUNOS) || defined(sun) || defined(__sun)
132 /*
133 * SunOS
134 */
135# undef PJ_SUNOS
136# define PJ_SUNOS 1
137# include <pj/compat/os_sunos.h>
138
139#elif defined(PJ_DARWINOS) || defined(__MACOSX__) || \
140 defined (__APPLE__) || defined (__MACH__)
141 /*
142 * MacOS X
143 */
144# undef PJ_DARWINOS
145# define PJ_DARWINOS 1
146# include <pj/compat/os_darwinos.h>
147
148#elif defined(PJ_RTEMS) && PJ_RTEMS!=0
149 /*
150 * RTEMS
151 */
152# include <pj/compat/os_rtems.h>
153#else
154# error "Please specify target os."
155#endif
156
157
158/********************************************************************
159 * Target machine specific configuration.
160 */
161#if defined(PJ_AUTOCONF)
162 /*
163 * Autoconf configured
164 */
165#include <pj/compat/m_auto.h>
166
167#elif defined (PJ_M_I386) || defined(_i386_) || defined(i_386_) || \
168 defined(_X86_) || defined(x86) || defined(__i386__) || \
169 defined(__i386) || defined(_M_IX86) || defined(__I86__)
170 /*
171 * Generic i386 processor family, little-endian
172 */
173# undef PJ_M_I386
174# define PJ_M_I386 1
175# define PJ_M_NAME "i386"
176# define PJ_HAS_PENTIUM 1
177# define PJ_IS_LITTLE_ENDIAN 1
178# define PJ_IS_BIG_ENDIAN 0
179
180#elif defined (PJ_M_X86_64) || defined(__amd64__) || defined(__amd64) || \
181 defined(__x86_64__) || defined(__x86_64) || \
182 defined(_M_X64) || defined(_M_AMD64)
183 /*
184 * AMD 64bit processor, little endian
185 */
186# undef PJ_M_X86_64
187# define PJ_M_X86_64 1
188# define PJ_M_NAME "x86_64"
189# define PJ_HAS_PENTIUM 1
190# define PJ_IS_LITTLE_ENDIAN 1
191# define PJ_IS_BIG_ENDIAN 0
192
193#elif defined(PJ_M_IA64) || defined(__ia64__) || defined(_IA64) || \
194 defined(__IA64__) || defined( _M_IA64)
195 /*
196 * Intel IA64 processor, default to little endian
197 */
198# undef PJ_M_IA64
199# define PJ_M_IA64 1
200# define PJ_M_NAME "ia64"
201# define PJ_HAS_PENTIUM 1
202# define PJ_IS_LITTLE_ENDIAN 1
203# define PJ_IS_BIG_ENDIAN 0
204
205#elif defined (PJ_M_M68K) && PJ_M_M68K != 0
206
207 /*
208 * Motorola m68k processor, big endian
209 */
210# undef PJ_M_M68K
211# define PJ_M_M68K 1
212# define PJ_M_NAME "m68k"
213# define PJ_HAS_PENTIUM 0
214# define PJ_IS_LITTLE_ENDIAN 0
215# define PJ_IS_BIG_ENDIAN 1
216
217
218#elif defined (PJ_M_ALPHA) || defined (__alpha__) || defined (__alpha) || \
219 defined (_M_ALPHA)
220 /*
221 * DEC Alpha processor, little endian
222 */
223# undef PJ_M_ALPHA
224# define PJ_M_ALPHA 1
225# define PJ_M_NAME "alpha"
226# define PJ_HAS_PENTIUM 0
227# define PJ_IS_LITTLE_ENDIAN 1
228# define PJ_IS_BIG_ENDIAN 0
229
230
231#elif defined(PJ_M_MIPS) || defined(__mips__) || defined(__mips) || \
232 defined(__MIPS__) || defined(MIPS) || defined(_MIPS_)
233 /*
234 * MIPS, bi-endian, so raise error if endianness is not configured
235 */
236# undef PJ_M_MIPS
237# define PJ_M_MIPS 1
238# define PJ_M_NAME "mips"
239# define PJ_HAS_PENTIUM 0
240# if !PJ_IS_LITTLE_ENDIAN && !PJ_IS_BIG_ENDIAN
241# error Endianness must be declared for this processor
242# endif
243
244
245#elif defined (PJ_M_SPARC) || defined( __sparc__) || defined(__sparc)
246 /*
247 * Sun Sparc, big endian
248 */
249# undef PJ_M_SPARC
250# define PJ_M_SPARC 1
251# define PJ_M_NAME "sparc"
252# define PJ_HAS_PENTIUM 0
253# define PJ_IS_LITTLE_ENDIAN 0
254# define PJ_IS_BIG_ENDIAN 1
255
256#elif defined(ARM) || defined(_ARM_) || defined(__arm__) || \
257 defined(_M_ARM) || defined(_M_ARM64) || defined(__aarch64__)
258# define PJ_HAS_PENTIUM 0
259 /*
260 * ARM, bi-endian, so raise error if endianness is not configured
261 */
262# if !PJ_IS_LITTLE_ENDIAN && !PJ_IS_BIG_ENDIAN
263# error Endianness must be declared for this processor
264# endif
265# if defined (PJ_M_ARMV7) || defined(ARMV7)
266# undef PJ_M_ARMV7
267# define PJ_M_ARM7 1
268# define PJ_M_NAME "armv7"
269# elif defined (PJ_M_ARMV4) || defined(ARMV4)
270# undef PJ_M_ARMV4
271# define PJ_M_ARMV4 1
272# define PJ_M_NAME "armv4"
273# elif defined (PJ_M_ARM64) || defined(ARM64) || defined(__aarch64__)
274# undef PJ_M_ARM64
275# define PJ_M_ARM64 1
276# define PJ_M_NAME "arm64"
277# endif
278
279#elif defined (PJ_M_POWERPC) || defined(__powerpc) || defined(__powerpc__) || \
280 defined(__POWERPC__) || defined(__ppc__) || defined(_M_PPC) || \
281 defined(_ARCH_PPC)
282 /*
283 * PowerPC, bi-endian, so raise error if endianness is not configured
284 */
285# undef PJ_M_POWERPC
286# define PJ_M_POWERPC 1
287# define PJ_M_NAME "powerpc"
288# define PJ_HAS_PENTIUM 0
289# if !PJ_IS_LITTLE_ENDIAN && !PJ_IS_BIG_ENDIAN
290# error Endianness must be declared for this processor
291# endif
292
293#elif defined (PJ_M_NIOS2) || defined(__nios2) || defined(__nios2__) || \
294 defined(__NIOS2__) || defined(__M_NIOS2) || defined(_ARCH_NIOS2)
295 /*
296 * Nios2, little endian
297 */
298# undef PJ_M_NIOS2
299# define PJ_M_NIOS2 1
300# define PJ_M_NAME "nios2"
301# define PJ_HAS_PENTIUM 0
302# define PJ_IS_LITTLE_ENDIAN 1
303# define PJ_IS_BIG_ENDIAN 0
304
305#else
306# error "Please specify target machine."
307#endif
308
309/* Include size_t definition. */
310#include <pj/compat/size_t.h>
311
312/* Include site/user specific configuration to control PJLIB features.
313 * YOU MUST CREATE THIS FILE YOURSELF!!
314 */
315#include <pj/config_site.h>
316
317/********************************************************************
318 * PJLIB Features.
319 */
320
321/* Overrides for DOXYGEN */
322#ifdef DOXYGEN
323# undef PJ_FUNCTIONS_ARE_INLINED
324# undef PJ_HAS_FLOATING_POINT
325# undef PJ_LOG_MAX_LEVEL
326# undef PJ_LOG_MAX_SIZE
327# undef PJ_LOG_USE_STACK_BUFFER
328# undef PJ_TERM_HAS_COLOR
329# undef PJ_POOL_DEBUG
330# undef PJ_HAS_TCP
331# undef PJ_MAX_HOSTNAME
332# undef PJ_IOQUEUE_MAX_HANDLES
333# undef FD_SETSIZE
334# undef PJ_HAS_SEMAPHORE
335# undef PJ_HAS_EVENT_OBJ
336# undef PJ_EXCEPTION_USE_WIN32_SEH
337# undef PJ_HAS_ERROR_STRING
338
339# define PJ_HAS_IPV6 1
340#endif
341
359#ifndef PJ_DEBUG
360# ifndef NDEBUG
361# define PJ_DEBUG 1
362# else
363# define PJ_DEBUG 0
364# endif
365#endif
366
375#ifndef PJ_DEBUG_MUTEX
376# define PJ_DEBUG_MUTEX 0
377#endif
378
384#ifndef PJ_FUNCTIONS_ARE_INLINED
385# define PJ_FUNCTIONS_ARE_INLINED 0
386#endif
387
393#ifndef PJ_HAS_FLOATING_POINT
394# define PJ_HAS_FLOATING_POINT 1
395#endif
396
414#ifndef PJ_LOG_MAX_LEVEL
415# define PJ_LOG_MAX_LEVEL 5
416#endif
417
426#ifndef PJ_LOG_MAX_SIZE
427# define PJ_LOG_MAX_SIZE 4000
428#endif
429
438#ifndef PJ_LOG_USE_STACK_BUFFER
439# define PJ_LOG_USE_STACK_BUFFER 1
440#endif
441
447#ifndef PJ_LOG_ENABLE_INDENT
448# define PJ_LOG_ENABLE_INDENT 1
449#endif
450
457#ifndef PJ_LOG_INDENT_SIZE
458# define PJ_LOG_INDENT_SIZE 1
459#endif
460
466#ifndef PJ_LOG_INDENT_CHAR
467# define PJ_LOG_INDENT_CHAR '.'
468#endif
469
475#ifndef PJ_LOG_SENDER_WIDTH
476# if PJ_HAS_STDINT_H
477# include <stdint.h>
478# if (UINTPTR_MAX == 0xffffffffffffffff)
479# define PJ_LOG_SENDER_WIDTH 22
480# else
481# define PJ_LOG_SENDER_WIDTH 14
482# endif
483# else
484# define PJ_LOG_SENDER_WIDTH 14
485# endif
486#endif
487
493#ifndef PJ_LOG_THREAD_WIDTH
494# define PJ_LOG_THREAD_WIDTH 12
495#endif
496
502#ifndef PJ_TERM_HAS_COLOR
503# define PJ_TERM_HAS_COLOR 1
504#endif
505
506
518#ifndef PJ_SAFE_POOL
519# define PJ_SAFE_POOL 0
520#endif
521
522
531#ifndef PJ_POOL_DEBUG
532# define PJ_POOL_DEBUG 0
533#endif
534
535
542#ifndef PJ_POOL_RELEASE_WIPE_DATA
543# define PJ_POOL_RELEASE_WIPE_DATA 0
544#endif
545
546
555#ifndef PJ_TIMER_DEBUG
556# define PJ_TIMER_DEBUG 1
557#endif
558
559
575#ifndef PJ_TIMER_USE_COPY
576# define PJ_TIMER_USE_COPY 1
577#endif
578
579
588#ifndef PJ_TIMER_USE_LINKED_LIST
589# define PJ_TIMER_USE_LINKED_LIST 0
590#endif
591
595#ifndef PJ_GRP_LOCK_DEBUG
596# define PJ_GRP_LOCK_DEBUG 0
597#endif
598
599
606#ifndef PJ_THREAD_DEFAULT_STACK_SIZE
607# define PJ_THREAD_DEFAULT_STACK_SIZE 8192
608#endif
609
610
618#ifndef PJ_OS_HAS_CHECK_STACK
619# define PJ_OS_HAS_CHECK_STACK 0
620#endif
621
627#ifndef PJ_HAS_POOL_ALT_API
628# define PJ_HAS_POOL_ALT_API PJ_POOL_DEBUG
629#endif
630
631
638#ifndef PJ_HAS_TCP
639# define PJ_HAS_TCP 1
640#endif
641
648#ifndef PJ_HAS_IPV6
649# define PJ_HAS_IPV6 0
650#endif
651
659#ifndef PJ_MAX_HOSTNAME
660# define PJ_MAX_HOSTNAME (128)
661#endif
662
669#ifndef PJ_ACTIVESOCK_MAX_CONSECUTIVE_ACCEPT_ERROR
670# define PJ_ACTIVESOCK_MAX_CONSECUTIVE_ACCEPT_ERROR 50
671#endif
672
680#ifndef PJ_IOQUEUE_MAX_HANDLES
681# define PJ_IOQUEUE_MAX_HANDLES (64)
682#endif
683
684
701#ifndef PJ_IOQUEUE_HAS_SAFE_UNREG
702# define PJ_IOQUEUE_HAS_SAFE_UNREG 1
703#endif
704
705
717#ifndef PJ_IOQUEUE_DEFAULT_ALLOW_CONCURRENCY
718# define PJ_IOQUEUE_DEFAULT_ALLOW_CONCURRENCY 1
719#endif
720
721
722/* Sanity check:
723 * if ioqueue concurrency is disallowed, PJ_IOQUEUE_HAS_SAFE_UNREG
724 * must be enabled.
725 */
726#if (PJ_IOQUEUE_DEFAULT_ALLOW_CONCURRENCY==0) && (PJ_IOQUEUE_HAS_SAFE_UNREG==0)
727# error PJ_IOQUEUE_HAS_SAFE_UNREG must be enabled if ioqueue concurrency \
728 is disabled
729#endif
730
731
741#ifndef PJ_IOQUEUE_KEY_FREE_DELAY
742# define PJ_IOQUEUE_KEY_FREE_DELAY 500
743#endif
744
745
752#ifndef PJ_IOQUEUE_DEFAULT_EPOLL_FLAGS
753# define PJ_IOQUEUE_DEFAULT_EPOLL_FLAGS PJ_IOQUEUE_EPOLL_AUTO
754#endif
755
756
762#ifndef PJ_FD_SETSIZE_SETABLE
763# if (defined(PJ_HAS_WINSOCK_H) && PJ_HAS_WINSOCK_H!=0) || \
764 (defined(PJ_HAS_WINSOCK2_H) && PJ_HAS_WINSOCK2_H!=0)
765# define PJ_FD_SETSIZE_SETABLE 1
766# else
767# define PJ_FD_SETSIZE_SETABLE 0
768# endif
769#endif
770
777#if PJ_FD_SETSIZE_SETABLE
778 /* Only override FD_SETSIZE if the value has not been set */
779# ifndef FD_SETSIZE
780# define FD_SETSIZE PJ_IOQUEUE_MAX_HANDLES
781# endif
782#else
783 /* When FD_SETSIZE is not changeable, check if PJ_IOQUEUE_MAX_HANDLES
784 * is lower than FD_SETSIZE value.
785 *
786 * Update: Not all ioqueue backends require this (such as epoll), so
787 * this check will be done on the ioqueue implementation itself, such as
788 * ioqueue select.
789 */
790/*
791# ifdef FD_SETSIZE
792# if PJ_IOQUEUE_MAX_HANDLES > FD_SETSIZE
793# error "PJ_IOQUEUE_MAX_HANDLES is greater than FD_SETSIZE"
794# endif
795# endif
796*/
797#endif
798
799
806#ifndef PJ_IP_HELPER_IGNORE_LOOPBACK_IF
807# define PJ_IP_HELPER_IGNORE_LOOPBACK_IF 1
808#endif
809
810
816#ifndef PJ_HAS_SEMAPHORE
817# define PJ_HAS_SEMAPHORE 1
818#endif
819
825#ifndef PJ_SEMAPHORE_USE_DISPATCH_SEM
826# if defined(PJ_DARWINOS) && PJ_DARWINOS != 0
827# define PJ_SEMAPHORE_USE_DISPATCH_SEM 1
828# else
829# define PJ_SEMAPHORE_USE_DISPATCH_SEM 0
830# endif
831#endif
832
833
839#ifndef PJ_HAS_EVENT_OBJ
840# define PJ_HAS_EVENT_OBJ 1
841#endif
842
843
847#ifndef PJ_MAXPATH
848# define PJ_MAXPATH 260
849#endif
850
851
863#ifndef PJ_HAS_EXCEPTION_NAMES
864# define PJ_HAS_EXCEPTION_NAMES 1
865#endif
866
874#ifndef PJ_MAX_EXCEPTION_ID
875# define PJ_MAX_EXCEPTION_ID 16
876#endif
877
884#ifndef PJ_EXCEPTION_USE_WIN32_SEH
885# define PJ_EXCEPTION_USE_WIN32_SEH 0
886#endif
887
894#ifndef PJ_TIMESTAMP_USE_RDTSC
895# define PJ_TIMESTAMP_USE_RDTSC 0
896#endif
897
902#ifndef PJ_NATIVE_ERR_POSITIVE
903# define PJ_NATIVE_ERR_POSITIVE 1
904#endif
905
912#ifndef PJ_HAS_ERROR_STRING
913# define PJ_HAS_ERROR_STRING 1
914#endif
915
916
925#ifndef PJ_HAS_STRICMP_ALNUM
926# define PJ_HAS_STRICMP_ALNUM 0
927#endif
928
929/*
930 * Warn about obsolete macros.
931 *
932 * PJ_ENABLE_EXTRA_CHECK has been deprecated in 2.13.
933 */
934#if defined(PJ_ENABLE_EXTRA_CHECK) && PJ_ENABLE_EXTRA_CHECK==0
935# ifdef _MSC_VER
936# pragma message("Warning: PJ_ENABLE_EXTRA_CHECK macro is deprecated"\
937 " and has no effect")
938# else
939# warning "PJ_ENABLE_EXTRA_CHECK macro is deprecated and has no effect"
940# endif
941#endif
942
943
944/*
945 * Types of QoS backend implementation.
946 */
947
952#define PJ_QOS_DUMMY 1
953
955#define PJ_QOS_BSD 2
956
958#define PJ_QOS_WM 3
959
961#define PJ_QOS_SYMBIAN 4
962
964#define PJ_QOS_DARWIN 5
965
969#ifndef PJ_QOS_IMPLEMENTATION
970# if defined(PJ_WIN32_WINCE) && PJ_WIN32_WINCE && _WIN32_WCE >= 0x502
971 /* Windows Mobile 6 or later */
972# define PJ_QOS_IMPLEMENTATION PJ_QOS_WM
973# elif defined(PJ_DARWINOS)
974 /* Darwin OS (e.g: iOS, MacOS, tvOS) */
975# define PJ_QOS_IMPLEMENTATION PJ_QOS_DARWIN
976# endif
977#endif
978
979
988#ifndef PJ_HAS_SSL_SOCK
989# define PJ_HAS_SSL_SOCK 0
990#endif
991
992
993/*
994 * Secure socket implementation.
995 * Select one of these implementations in PJ_SSL_SOCK_IMP.
996 */
997#define PJ_SSL_SOCK_IMP_NONE 0
998#define PJ_SSL_SOCK_IMP_OPENSSL 1
999#define PJ_SSL_SOCK_IMP_GNUTLS 2
1000#define PJ_SSL_SOCK_IMP_DARWIN 3
1003#define PJ_SSL_SOCK_IMP_APPLE 4
1015#ifndef PJ_SSL_SOCK_IMP
1016# if PJ_HAS_SSL_SOCK==0
1017# define PJ_SSL_SOCK_IMP PJ_SSL_SOCK_IMP_NONE
1018# else
1019# define PJ_SSL_SOCK_IMP PJ_SSL_SOCK_IMP_OPENSSL
1020# endif
1021#endif
1022
1023
1029#ifndef PJ_SSL_SOCK_MAX_CIPHERS
1030# define PJ_SSL_SOCK_MAX_CIPHERS 256
1031#endif
1032
1033
1041#ifndef PJ_SSL_SOCK_OSSL_CIPHERS
1042# define PJ_SSL_SOCK_OSSL_CIPHERS "HIGH:-COMPLEMENTOFDEFAULT"
1043#endif
1044
1045
1051#ifndef PJ_SSL_SOCK_MAX_CURVES
1052# define PJ_SSL_SOCK_MAX_CURVES 32
1053#endif
1054
1061#ifndef PJ_SSL_SOCK_OSSL_USE_THREAD_CB
1062# define PJ_SSL_SOCK_OSSL_USE_THREAD_CB 1
1063#else
1064# define PJ_SSL_SOCK_OSSL_USE_THREAD_CB 0
1065#endif
1066
1067
1074#ifndef PJ_SOCK_DISABLE_WSAECONNRESET
1075# define PJ_SOCK_DISABLE_WSAECONNRESET 1
1076#endif
1077
1078
1084#ifndef PJ_MAX_SOCKOPT_PARAMS
1085# define PJ_MAX_SOCKOPT_PARAMS 4
1086#endif
1087
1088
1089
1092/********************************************************************
1093 * General macros.
1094 */
1095
1178#define PJ_INLINE(type) PJ_INLINE_SPECIFIER type
1179
1188#ifndef PJ_EXPORT_DECL_SPECIFIER
1189# define PJ_EXPORT_DECL_SPECIFIER
1190#endif
1191
1192
1201#ifndef PJ_EXPORT_DEF_SPECIFIER
1202# define PJ_EXPORT_DEF_SPECIFIER
1203#endif
1204
1205
1213#ifndef PJ_IMPORT_DECL_SPECIFIER
1214# define PJ_IMPORT_DECL_SPECIFIER
1215#endif
1216
1217
1221#ifndef PJ_EXPORT_SYMBOL
1222# define PJ_EXPORT_SYMBOL(x)
1223#endif
1224
1225
1231#if defined(PJ_DLL)
1232# if defined(PJ_EXPORTING)
1233# define PJ_DECL(type) PJ_EXPORT_DECL_SPECIFIER type
1234# else
1235# define PJ_DECL(type) PJ_IMPORT_DECL_SPECIFIER type
1236# endif
1237#elif !defined(PJ_DECL)
1238# if defined(__cplusplus)
1239# define PJ_DECL(type) type
1240# else
1241# define PJ_DECL(type) extern type
1242# endif
1243#endif
1244
1245
1251#if defined(PJ_DLL) && defined(PJ_EXPORTING)
1252# define PJ_DEF(type) PJ_EXPORT_DEF_SPECIFIER type
1253#elif !defined(PJ_DEF)
1254# define PJ_DEF(type) type
1255#endif
1256
1257
1276#ifdef __cplusplus
1277# define PJ_DECL_NO_RETURN(type) PJ_DECL(type) PJ_NORETURN
1278# define PJ_IDECL_NO_RETURN(type) PJ_INLINE(type) PJ_NORETURN
1279# define PJ_BEGIN_DECL extern "C" {
1280# define PJ_END_DECL }
1281#else
1282# define PJ_DECL_NO_RETURN(type) PJ_NORETURN PJ_DECL(type)
1283# define PJ_IDECL_NO_RETURN(type) PJ_NORETURN PJ_INLINE(type)
1284# define PJ_BEGIN_DECL
1285# define PJ_END_DECL
1286#endif
1287
1288
1289
1295#if defined(PJ_DLL)
1296# if defined(PJ_EXPORTING)
1297# define PJ_DECL_DATA(type) PJ_EXPORT_DECL_SPECIFIER extern type
1298# else
1299# define PJ_DECL_DATA(type) PJ_IMPORT_DECL_SPECIFIER extern type
1300# endif
1301#elif !defined(PJ_DECL_DATA)
1302# define PJ_DECL_DATA(type) extern type
1303#endif
1304
1305
1311#if defined(PJ_DLL) && defined(PJ_EXPORTING)
1312# define PJ_DEF_DATA(type) PJ_EXPORT_DEF_SPECIFIER type
1313#elif !defined(PJ_DEF_DATA)
1314# define PJ_DEF_DATA(type) type
1315#endif
1316
1317
1329#if PJ_FUNCTIONS_ARE_INLINED
1330# define PJ_IDECL(type) PJ_INLINE(type)
1331# define PJ_IDEF(type) PJ_INLINE(type)
1332#else
1333# define PJ_IDECL(type) PJ_DECL(type)
1334# define PJ_IDEF(type) PJ_DEF(type)
1335#endif
1336
1337
1343#define PJ_UNUSED_ARG(arg) (void)arg
1344
1351#ifndef PJ_TODO
1352# define PJ_TODO(id) TODO___##id:
1353#endif
1354
1359#ifndef PJ_RACE_ME
1360# define PJ_RACE_ME(x)
1361#endif
1362
1368#define __pj_throw__(x)
1369
1372/********************************************************************
1373 * Sanity Checks
1374 */
1375#ifndef PJ_HAS_HIGH_RES_TIMER
1376# error "PJ_HAS_HIGH_RES_TIMER is not defined!"
1377#endif
1378
1379#if !defined(PJ_HAS_PENTIUM)
1380# error "PJ_HAS_PENTIUM is not defined!"
1381#endif
1382
1383#if !defined(PJ_IS_LITTLE_ENDIAN)
1384# error "PJ_IS_LITTLE_ENDIAN is not defined!"
1385#endif
1386
1387#if !defined(PJ_IS_BIG_ENDIAN)
1388# error "PJ_IS_BIG_ENDIAN is not defined!"
1389#endif
1390
1391#if !defined(PJ_EMULATE_RWMUTEX)
1392# error "PJ_EMULATE_RWMUTEX should be defined in compat/os_xx.h"
1393#endif
1394
1395#if !defined(PJ_THREAD_SET_STACK_SIZE)
1396# error "PJ_THREAD_SET_STACK_SIZE should be defined in compat/os_xx.h"
1397#endif
1398
1399#if !defined(PJ_THREAD_ALLOCATE_STACK)
1400# error "PJ_THREAD_ALLOCATE_STACK should be defined in compat/os_xx.h"
1401#endif
1402
1404
1406#define PJ_VERSION_NUM_MAJOR 2
1407
1409#define PJ_VERSION_NUM_MINOR 13
1410
1412#define PJ_VERSION_NUM_REV 0
1413
1418#define PJ_VERSION_NUM_EXTRA ""
1419
1425#define PJ_VERSION_NUM ((PJ_VERSION_NUM_MAJOR << 24) | \
1426 (PJ_VERSION_NUM_MINOR << 16) | \
1427 (PJ_VERSION_NUM_REV << 8))
1428
1432PJ_DECL_DATA(const char*) PJ_VERSION;
1433
1439PJ_DECL(const char*) pj_get_version(void);
1440
1444PJ_DECL(void) pj_dump_config(void);
1445
1447
1448
1449#endif /* __PJ_CONFIG_H__ */
1450
void pj_dump_config(void)
const char * pj_get_version(void)
const char * PJ_VERSION
Definition: config.h:1432
#define PJ_BEGIN_DECL
Definition: config.h:1284
#define PJ_END_DECL
Definition: config.h:1285

 


PJLIB Open Source, high performance, small footprint, and very very portable framework
Copyright (C) 2006-2009 Teluu Inc.