~ubuntu-branches/ubuntu/wily/sflphone/wily

« back to all changes in this revision

Viewing changes to daemon/libs/pjproject-2.1.0/pjlib/include/pj/config.h

  • Committer: Package Import Robot
  • Author(s): Jonathan Riddell
  • Date: 2015-01-07 14:51:16 UTC
  • mfrom: (4.3.5 sid)
  • Revision ID: package-import@ubuntu.com-20150107145116-yxnafinf4lrdvrmx
Tags: 1.4.1-0.1ubuntu1
* Merge with Debian, remaining changes:
 - Drop soprano, nepomuk build-dep
* Drop ubuntu patches, now upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* $Id: config.h 4415 2013-03-05 08:34:45Z ming $ */
2
 
/* 
3
 
 * Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com)
4
 
 * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
5
 
 *
6
 
 * This program is free software; you can redistribute it and/or modify
7
 
 * it under the terms of the GNU General Public License as published by
8
 
 * the Free Software Foundation; either version 2 of the License, or
9
 
 * (at your option) any later version.
10
 
 *
11
 
 * This program is distributed in the hope that it will be useful,
12
 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 
 * GNU General Public License for more details.
15
 
 *
16
 
 * You should have received a copy of the GNU General Public License
17
 
 * along with this program; if not, write to the Free Software
18
 
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 
19
 
 */
20
 
#ifndef __PJ_CONFIG_H__
21
 
#define __PJ_CONFIG_H__
22
 
 
23
 
 
24
 
/**
25
 
 * @file config.h
26
 
 * @brief PJLIB Main configuration settings.
27
 
 */
28
 
 
29
 
/********************************************************************
30
 
 * Include compiler specific configuration.
31
 
 */
32
 
#if defined(_MSC_VER)
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>
44
 
#else
45
 
#  error "Unknown compiler."
46
 
#endif
47
 
 
48
 
/* PJ_ALIGN_DATA is compiler specific directive to align data address */
49
 
#ifndef PJ_ALIGN_DATA
50
 
#  error "PJ_ALIGN_DATA is not defined!"
51
 
#endif
52
 
 
53
 
/********************************************************************
54
 
 * Include target OS specific configuration.
55
 
 */
56
 
#if defined(PJ_AUTOCONF)
57
 
    /*
58
 
     * Autoconf
59
 
     */
60
 
#   include <pj/compat/os_auto.h>
61
 
 
62
 
#elif defined(PJ_SYMBIAN) && PJ_SYMBIAN!=0
63
 
    /*
64
 
     * SymbianOS
65
 
     */
66
 
#  include <pj/compat/os_symbian.h>
67
 
 
68
 
#elif defined(PJ_WIN32_WINCE) || defined(_WIN32_WCE) || defined(UNDER_CE)
69
 
    /*
70
 
     * Windows CE
71
 
     */
72
 
#   undef PJ_WIN32_WINCE
73
 
#   define PJ_WIN32_WINCE   1
74
 
#   include <pj/compat/os_win32_wince.h>
75
 
 
76
 
    /* Also define Win32 */
77
 
#   define PJ_WIN32 1
78
 
 
79
 
#elif defined(PJ_WIN32) || defined(_WIN32) || defined(__WIN32__) || \
80
 
        defined(_WIN64) || defined(WIN32) || defined(__TOS_WIN__)
81
 
    /*
82
 
     * Win32
83
 
     */
84
 
#   undef PJ_WIN32
85
 
#   define PJ_WIN32 1
86
 
#   include <pj/compat/os_win32.h>
87
 
 
88
 
#elif defined(PJ_LINUX_KERNEL) && PJ_LINUX_KERNEL!=0
89
 
    /*
90
 
     * Linux kernel
91
 
     */
92
 
#  include <pj/compat/os_linux_kernel.h>
93
 
 
94
 
#elif defined(PJ_LINUX) || defined(linux) || defined(__linux)
95
 
    /*
96
 
     * Linux
97
 
     */
98
 
#   undef PJ_LINUX
99
 
#   define PJ_LINUX         1
100
 
#   include <pj/compat/os_linux.h>
101
 
 
102
 
#elif defined(PJ_PALMOS) && PJ_PALMOS!=0
103
 
    /*
104
 
     * Palm
105
 
     */
106
 
#  include <pj/compat/os_palmos.h>
107
 
 
108
 
#elif defined(PJ_SUNOS) || defined(sun) || defined(__sun)
109
 
    /*
110
 
     * SunOS
111
 
     */
112
 
#   undef PJ_SUNOS
113
 
#   define PJ_SUNOS         1
114
 
#   include <pj/compat/os_sunos.h>
115
 
 
116
 
#elif defined(PJ_DARWINOS) || defined(__MACOSX__) || \
117
 
      defined (__APPLE__) || defined (__MACH__)
118
 
    /*
119
 
     * MacOS X
120
 
     */
121
 
#   undef PJ_DARWINOS
122
 
#   define PJ_DARWINOS      1
123
 
#   include <pj/compat/os_darwinos.h>
124
 
 
125
 
#elif defined(PJ_RTEMS) && PJ_RTEMS!=0
126
 
    /*
127
 
     * RTEMS
128
 
     */
129
 
#  include <pj/compat/os_rtems.h>
130
 
#else
131
 
#   error "Please specify target os."
132
 
#endif
133
 
 
134
 
 
135
 
/********************************************************************
136
 
 * Target machine specific configuration.
137
 
 */
138
 
#if defined(PJ_AUTOCONF)
139
 
    /*
140
 
     * Autoconf configured
141
 
     */
142
 
#include <pj/compat/m_auto.h>
143
 
 
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__)
147
 
    /*
148
 
     * Generic i386 processor family, little-endian
149
 
     */
150
 
#   undef PJ_M_I386
151
 
#   define PJ_M_I386            1
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
156
 
 
157
 
 
158
 
#elif defined (PJ_M_X86_64) || defined(__amd64__) || defined(__amd64) || \
159
 
        defined(__x86_64__) || defined(__x86_64)
160
 
    /*
161
 
     * AMD 64bit processor, little endian
162
 
     */
163
 
#   undef PJ_M_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
169
 
 
170
 
#elif defined(PJ_M_IA64) || defined(__ia64__) || defined(_IA64) || \
171
 
        defined(__IA64__) || defined(   _M_IA64)
172
 
    /*
173
 
     * Intel IA64 processor, default to little endian
174
 
     */
175
 
#   undef PJ_M_IA64
176
 
#   define PJ_M_IA64            1
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
181
 
 
182
 
#elif defined (PJ_M_M68K) && PJ_M_M68K != 0
183
 
 
184
 
    /*
185
 
     * Motorola m68k processor, big endian
186
 
     */
187
 
#   undef PJ_M_M68K
188
 
#   define PJ_M_M68K            1
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
193
 
 
194
 
 
195
 
#elif defined (PJ_M_ALPHA) || defined (__alpha__) || defined (__alpha) || \
196
 
        defined (_M_ALPHA)
197
 
    /*
198
 
     * DEC Alpha processor, little endian
199
 
     */
200
 
#   undef PJ_M_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
206
 
 
207
 
 
208
 
#elif defined(PJ_M_MIPS) || defined(__mips__) || defined(__mips) || \
209
 
        defined(__MIPS__) || defined(MIPS) || defined(_MIPS_)
210
 
    /*
211
 
     * MIPS, bi-endian, so raise error if endianness is not configured
212
 
     */
213
 
#   undef PJ_M_MIPS
214
 
#   define PJ_M_MIPS            1
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
219
 
#   endif
220
 
 
221
 
 
222
 
#elif defined (PJ_M_SPARC) || defined(  __sparc__) || defined(__sparc)
223
 
    /*
224
 
     * Sun Sparc, big endian
225
 
     */
226
 
#   undef PJ_M_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
232
 
 
233
 
#elif defined (PJ_M_ARMV4) || defined(ARM) || defined(_ARM_) ||  \
234
 
        defined(ARMV4) || defined(__arm__)
235
 
    /*
236
 
     * ARM, bi-endian, so raise error if endianness is not configured
237
 
     */
238
 
#   undef PJ_M_ARMV4
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
244
 
#   endif
245
 
 
246
 
#elif defined (PJ_M_POWERPC) || defined(__powerpc) || defined(__powerpc__) || \
247
 
        defined(__POWERPC__) || defined(__ppc__) || defined(_M_PPC) || \
248
 
        defined(_ARCH_PPC)
249
 
    /*
250
 
     * PowerPC, bi-endian, so raise error if endianness is not configured
251
 
     */
252
 
#   undef PJ_M_POWERPC
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
258
 
#   endif
259
 
 
260
 
#elif defined (PJ_M_NIOS2) || defined(__nios2) || defined(__nios2__) || \
261
 
      defined(__NIOS2__) || defined(__M_NIOS2) || defined(_ARCH_NIOS2)
262
 
    /*
263
 
     * Nios2, little endian
264
 
     */
265
 
#   undef PJ_M_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
271
 
                
272
 
#else
273
 
#   error "Please specify target machine."
274
 
#endif
275
 
 
276
 
/* Include size_t definition. */
277
 
#include <pj/compat/size_t.h>
278
 
 
279
 
/* Include site/user specific configuration to control PJLIB features.
280
 
 * YOU MUST CREATE THIS FILE YOURSELF!!
281
 
 */
282
 
#include <pj/config_site.h>
283
 
 
284
 
/********************************************************************
285
 
 * PJLIB Features.
286
 
 */
287
 
 
288
 
/* Overrides for DOXYGEN */
289
 
#ifdef DOXYGEN
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
297
 
#   undef PJ_HAS_TCP
298
 
#   undef PJ_MAX_HOSTNAME
299
 
#   undef PJ_IOQUEUE_MAX_HANDLES
300
 
#   undef FD_SETSIZE
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
306
 
 
307
 
#   define PJ_HAS_IPV6  1
308
 
#endif
309
 
 
310
 
/**
311
 
 * @defgroup pj_config Build Configuration
312
 
 * @{
313
 
 *
314
 
 * This section contains macros that can set during PJLIB build process
315
 
 * to controll various aspects of the library.
316
 
 *
317
 
 * <b>Note</b>: the values in this page does NOT necessarily reflect to the
318
 
 * macro values during the build process.
319
 
 */
320
 
 
321
 
/**
322
 
 * If this macro is set to 1, it will enable some debugging checking
323
 
 * in the library.
324
 
 *
325
 
 * Default: equal to (NOT NDEBUG).
326
 
 */
327
 
#ifndef PJ_DEBUG
328
 
#  ifndef NDEBUG
329
 
#    define PJ_DEBUG                1
330
 
#  else
331
 
#    define PJ_DEBUG                0
332
 
#  endif
333
 
#endif
334
 
 
335
 
/**
336
 
 * Enable this macro to activate logging to mutex/semaphore related events.
337
 
 * This is useful to troubleshoot concurrency problems such as deadlocks.
338
 
 * In addition, you should also add PJ_LOG_HAS_THREAD_ID flag to the
339
 
 * log decoration to assist the troubleshooting.
340
 
 *
341
 
 * Default: 0
342
 
 */
343
 
#ifndef PJ_DEBUG_MUTEX
344
 
#   define PJ_DEBUG_MUTEX           0
345
 
#endif
346
 
 
347
 
/**
348
 
 * Expand functions in *_i.h header files as inline.
349
 
 *
350
 
 * Default: 0.
351
 
 */
352
 
#ifndef PJ_FUNCTIONS_ARE_INLINED
353
 
#  define PJ_FUNCTIONS_ARE_INLINED  0
354
 
#endif
355
 
 
356
 
/**
357
 
 * Use floating point computations in the library.
358
 
 *
359
 
 * Default: 1.
360
 
 */
361
 
#ifndef PJ_HAS_FLOATING_POINT
362
 
#  define PJ_HAS_FLOATING_POINT     1
363
 
#endif
364
 
 
365
 
/**
366
 
 * Declare maximum logging level/verbosity. Lower number indicates higher
367
 
 * importance, with the highest importance has level zero. The least
368
 
 * important level is five in this implementation, but this can be extended
369
 
 * by supplying the appropriate implementation.
370
 
 *
371
 
 * The level conventions:
372
 
 *  - 0: fatal error
373
 
 *  - 1: error
374
 
 *  - 2: warning
375
 
 *  - 3: info
376
 
 *  - 4: debug
377
 
 *  - 5: trace
378
 
 *  - 6: more detailed trace
379
 
 *
380
 
 * Default: 4
381
 
 */
382
 
#ifndef PJ_LOG_MAX_LEVEL
383
 
#  define PJ_LOG_MAX_LEVEL   5
384
 
#endif
385
 
 
386
 
/**
387
 
 * Maximum message size that can be sent to output device for each call
388
 
 * to PJ_LOG(). If the message size is longer than this value, it will be cut.
389
 
 * This may affect the stack usage, depending whether PJ_LOG_USE_STACK_BUFFER
390
 
 * flag is set.
391
 
 *
392
 
 * Default: 4000
393
 
 */
394
 
#ifndef PJ_LOG_MAX_SIZE
395
 
#  define PJ_LOG_MAX_SIZE           4000
396
 
#endif
397
 
 
398
 
/**
399
 
 * Log buffer.
400
 
 * Does the log get the buffer from the stack? (default is yes).
401
 
 * If the value is set to NO, then the buffer will be taken from static
402
 
 * buffer, which in this case will make the log function non-reentrant.
403
 
 *
404
 
 * Default: 1
405
 
 */
406
 
#ifndef PJ_LOG_USE_STACK_BUFFER
407
 
#  define PJ_LOG_USE_STACK_BUFFER   1
408
 
#endif
409
 
 
410
 
/**
411
 
 * Enable log indentation feature.
412
 
 *
413
 
 * Default: 1
414
 
 */
415
 
#ifndef PJ_LOG_ENABLE_INDENT
416
 
#   define PJ_LOG_ENABLE_INDENT        1
417
 
#endif
418
 
 
419
 
/**
420
 
 * Number of PJ_LOG_INDENT_CHAR to put every time pj_log_push_indent()
421
 
 * is called.
422
 
 *
423
 
 * Default: 1
424
 
 */
425
 
#ifndef PJ_LOG_INDENT_SIZE
426
 
#   define PJ_LOG_INDENT_SIZE        1
427
 
#endif
428
 
 
429
 
/**
430
 
 * Log indentation character.
431
 
 *
432
 
 * Default: space
433
 
 */
434
 
#ifndef PJ_LOG_INDENT_CHAR
435
 
#   define PJ_LOG_INDENT_CHAR       '.'
436
 
#endif
437
 
 
438
 
/**
439
 
 * Colorfull terminal (for logging etc).
440
 
 *
441
 
 * Default: 1
442
 
 */
443
 
#ifndef PJ_TERM_HAS_COLOR
444
 
#  define PJ_TERM_HAS_COLOR         1
445
 
#endif
446
 
 
447
 
 
448
 
/**
449
 
 * Set this flag to non-zero to enable various checking for pool
450
 
 * operations. When this flag is set, assertion must be enabled
451
 
 * in the application.
452
 
 *
453
 
 * This will slow down pool creation and destruction and will add
454
 
 * few bytes of overhead, so application would normally want to 
455
 
 * disable this feature on release build.
456
 
 *
457
 
 * Default: 0
458
 
 */
459
 
#ifndef PJ_SAFE_POOL
460
 
#   define PJ_SAFE_POOL             0
461
 
#endif
462
 
 
463
 
 
464
 
/**
465
 
 * If pool debugging is used, then each memory allocation from the pool
466
 
 * will call malloc(), and pool will release all memory chunks when it
467
 
 * is destroyed. This works better when memory verification programs
468
 
 * such as Rational Purify is used.
469
 
 *
470
 
 * Default: 0
471
 
 */
472
 
#ifndef PJ_POOL_DEBUG
473
 
#  define PJ_POOL_DEBUG             0
474
 
#endif
475
 
 
476
 
 
477
 
/**
478
 
 * Enable timer heap debugging facility. When this is enabled, application
479
 
 * can call pj_timer_heap_dump() to show the contents of the timer heap
480
 
 * along with the source location where the timer entries were scheduled.
481
 
 * See https://trac.pjsip.org/repos/ticket/1527 for more info.
482
 
 *
483
 
 * Default: 0
484
 
 */
485
 
#ifndef PJ_TIMER_DEBUG
486
 
#  define PJ_TIMER_DEBUG            0
487
 
#endif
488
 
 
489
 
 
490
 
/**
491
 
 * Set this to 1 to enable debugging on the group lock. Default: 0
492
 
 */
493
 
#ifndef PJ_GRP_LOCK_DEBUG
494
 
#  define PJ_GRP_LOCK_DEBUG     0
495
 
#endif
496
 
 
497
 
 
498
 
/**
499
 
 * Specify this as \a stack_size argument in #pj_thread_create() to specify
500
 
 * that thread should use default stack size for the current platform.
501
 
 *
502
 
 * Default: 8192
503
 
 */
504
 
#ifndef PJ_THREAD_DEFAULT_STACK_SIZE 
505
 
#  define PJ_THREAD_DEFAULT_STACK_SIZE    8192
506
 
#endif
507
 
 
508
 
 
509
 
/**
510
 
 * Specify if PJ_CHECK_STACK() macro is enabled to check the sanity of 
511
 
 * the stack. The OS implementation may check that no stack overflow 
512
 
 * occurs, and it also may collect statistic about stack usage. Note
513
 
 * that this will increase the footprint of the libraries since it
514
 
 * tracks the filename and line number of each functions.
515
 
 */
516
 
#ifndef PJ_OS_HAS_CHECK_STACK
517
 
#       define PJ_OS_HAS_CHECK_STACK            0
518
 
#endif
519
 
 
520
 
/**
521
 
 * Do we have alternate pool implementation?
522
 
 *
523
 
 * Default: 0
524
 
 */
525
 
#ifndef PJ_HAS_POOL_ALT_API
526
 
#   define PJ_HAS_POOL_ALT_API      PJ_POOL_DEBUG
527
 
#endif
528
 
 
529
 
 
530
 
/**
531
 
 * Support TCP in the library.
532
 
 * Disabling TCP will reduce the footprint slightly (about 6KB).
533
 
 *
534
 
 * Default: 1
535
 
 */
536
 
#ifndef PJ_HAS_TCP
537
 
#  define PJ_HAS_TCP                1
538
 
#endif
539
 
 
540
 
/**
541
 
 * Support IPv6 in the library. If this support is disabled, some IPv6 
542
 
 * related functions will return PJ_EIPV6NOTSUP.
543
 
 *
544
 
 * Default: 0 (disabled, for now)
545
 
 */
546
 
#ifndef PJ_HAS_IPV6
547
 
#  define PJ_HAS_IPV6               0
548
 
#endif
549
 
 
550
 
 /**
551
 
 * Maximum hostname length.
552
 
 * Libraries sometimes needs to make copy of an address to stack buffer;
553
 
 * the value here affects the stack usage.
554
 
 *
555
 
 * Default: 128
556
 
 */
557
 
#ifndef PJ_MAX_HOSTNAME
558
 
#  define PJ_MAX_HOSTNAME           (128)
559
 
#endif
560
 
 
561
 
/**
562
 
 * Maximum consecutive identical error for accept() operation before
563
 
 * activesock stops calling the next ioqueue accept.
564
 
 *
565
 
 * Default: 50
566
 
 */
567
 
#ifndef PJ_ACTIVESOCK_MAX_CONSECUTIVE_ACCEPT_ERROR
568
 
#   define PJ_ACTIVESOCK_MAX_CONSECUTIVE_ACCEPT_ERROR 50
569
 
#endif
570
 
 
571
 
/**
572
 
 * Constants for declaring the maximum handles that can be supported by
573
 
 * a single IOQ framework. This constant might not be relevant to the 
574
 
 * underlying I/O queue impelementation, but still, developers should be 
575
 
 * aware of this constant, to make sure that the program will not break when
576
 
 * the underlying implementation changes.
577
 
 */
578
 
#ifndef PJ_IOQUEUE_MAX_HANDLES
579
 
#   define PJ_IOQUEUE_MAX_HANDLES       (64)
580
 
#endif
581
 
 
582
 
 
583
 
/**
584
 
 * If PJ_IOQUEUE_HAS_SAFE_UNREG macro is defined, then ioqueue will do more
585
 
 * things to ensure thread safety of handle unregistration operation by
586
 
 * employing reference counter to each handle.
587
 
 *
588
 
 * In addition, the ioqueue will preallocate memory for the handles, 
589
 
 * according to the maximum number of handles that is specified during 
590
 
 * ioqueue creation.
591
 
 *
592
 
 * All applications would normally want this enabled, but you may disable
593
 
 * this if:
594
 
 *  - there is no dynamic unregistration to all ioqueues.
595
 
 *  - there is no threading, or there is no preemptive multitasking.
596
 
 *
597
 
 * Default: 1
598
 
 */
599
 
#ifndef PJ_IOQUEUE_HAS_SAFE_UNREG
600
 
#   define PJ_IOQUEUE_HAS_SAFE_UNREG    1
601
 
#endif
602
 
 
603
 
 
604
 
/**
605
 
 * Default concurrency setting for sockets/handles registered to ioqueue.
606
 
 * This controls whether the ioqueue is allowed to call the key's callback
607
 
 * concurrently/in parallel. The default is yes, which means that if there
608
 
 * are more than one pending operations complete simultaneously, more
609
 
 * than one threads may call the key's callback at the same time. This
610
 
 * generally would promote good scalability for application, at the 
611
 
 * expense of more complexity to manage the concurrent accesses.
612
 
 *
613
 
 * Please see the ioqueue documentation for more info.
614
 
 */
615
 
#ifndef PJ_IOQUEUE_DEFAULT_ALLOW_CONCURRENCY
616
 
#   define PJ_IOQUEUE_DEFAULT_ALLOW_CONCURRENCY   1
617
 
#endif
618
 
 
619
 
 
620
 
/* Sanity check:
621
 
 *  if ioqueue concurrency is disallowed, PJ_IOQUEUE_HAS_SAFE_UNREG
622
 
 *  must be enabled.
623
 
 */
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 \
626
 
          is disabled
627
 
#endif
628
 
 
629
 
 
630
 
/**
631
 
 * When safe unregistration (PJ_IOQUEUE_HAS_SAFE_UNREG) is configured in
632
 
 * ioqueue, the PJ_IOQUEUE_KEY_FREE_DELAY macro specifies how long the
633
 
 * ioqueue key is kept in closing state before it can be reused.
634
 
 *
635
 
 * The value is in miliseconds.
636
 
 *
637
 
 * Default: 500 msec.
638
 
 */
639
 
#ifndef PJ_IOQUEUE_KEY_FREE_DELAY
640
 
#   define PJ_IOQUEUE_KEY_FREE_DELAY    500
641
 
#endif
642
 
 
643
 
 
644
 
/**
645
 
 * Determine if FD_SETSIZE is changeable/set-able. If so, then we will
646
 
 * set it to PJ_IOQUEUE_MAX_HANDLES. Currently we detect this by checking
647
 
 * for Winsock.
648
 
 */
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
653
 
#   else
654
 
#       define PJ_FD_SETSIZE_SETABLE    0
655
 
#   endif
656
 
#endif
657
 
 
658
 
/**
659
 
 * Overrides FD_SETSIZE so it is consistent throughout the library.
660
 
 * We only do this if we detected that FD_SETSIZE is changeable. If
661
 
 * FD_SETSIZE is not set-able, then PJ_IOQUEUE_MAX_HANDLES must be
662
 
 * set to value lower than FD_SETSIZE.
663
 
 */
664
 
#if PJ_FD_SETSIZE_SETABLE
665
 
    /* Only override FD_SETSIZE if the value has not been set */
666
 
#   ifndef FD_SETSIZE
667
 
#       define FD_SETSIZE               PJ_IOQUEUE_MAX_HANDLES
668
 
#   endif
669
 
#else
670
 
    /* When FD_SETSIZE is not changeable, check if PJ_IOQUEUE_MAX_HANDLES
671
 
     * is lower than FD_SETSIZE value.
672
 
     */
673
 
#   ifdef FD_SETSIZE
674
 
#       if PJ_IOQUEUE_MAX_HANDLES > FD_SETSIZE
675
 
#           error "PJ_IOQUEUE_MAX_HANDLES is greater than FD_SETSIZE"
676
 
#       endif
677
 
#   endif
678
 
#endif
679
 
 
680
 
 
681
 
/**
682
 
 * Specify whether #pj_enum_ip_interface() function should exclude
683
 
 * loopback interfaces.
684
 
 *
685
 
 * Default: 1
686
 
 */
687
 
#ifndef PJ_IP_HELPER_IGNORE_LOOPBACK_IF
688
 
#   define PJ_IP_HELPER_IGNORE_LOOPBACK_IF      1
689
 
#endif
690
 
 
691
 
 
692
 
/**
693
 
 * Has semaphore functionality?
694
 
 *
695
 
 * Default: 1
696
 
 */
697
 
#ifndef PJ_HAS_SEMAPHORE
698
 
#  define PJ_HAS_SEMAPHORE          1
699
 
#endif
700
 
 
701
 
 
702
 
/**
703
 
 * Event object (for synchronization, e.g. in Win32)
704
 
 *
705
 
 * Default: 1
706
 
 */
707
 
#ifndef PJ_HAS_EVENT_OBJ
708
 
#  define PJ_HAS_EVENT_OBJ          1
709
 
#endif
710
 
 
711
 
 
712
 
/**
713
 
 * Maximum file name length.
714
 
 */
715
 
#ifndef PJ_MAXPATH
716
 
#   define PJ_MAXPATH               260
717
 
#endif
718
 
 
719
 
 
720
 
/**
721
 
 * Enable library's extra check.
722
 
 * If this macro is enabled, #PJ_ASSERT_RETURN macro will expand to
723
 
 * run-time checking. If this macro is disabled, #PJ_ASSERT_RETURN
724
 
 * will simply evaluate to #pj_assert().
725
 
 *
726
 
 * You can disable this macro to reduce size, at the risk of crashes
727
 
 * if invalid value (e.g. NULL) is passed to the library.
728
 
 *
729
 
 * Default: 1
730
 
 */
731
 
#ifndef PJ_ENABLE_EXTRA_CHECK
732
 
#   define PJ_ENABLE_EXTRA_CHECK    1
733
 
#endif
734
 
 
735
 
 
736
 
/**
737
 
 * Enable name registration for exceptions with #pj_exception_id_alloc().
738
 
 * If this feature is enabled, then the library will keep track of
739
 
 * names associated with each exception ID requested by application via
740
 
 * #pj_exception_id_alloc().
741
 
 *
742
 
 * Disabling this macro will reduce the code and .bss size by a tad bit.
743
 
 * See also #PJ_MAX_EXCEPTION_ID.
744
 
 *
745
 
 * Default: 1
746
 
 */
747
 
#ifndef PJ_HAS_EXCEPTION_NAMES
748
 
#   define PJ_HAS_EXCEPTION_NAMES   1
749
 
#endif
750
 
 
751
 
/**
752
 
 * Maximum number of unique exception IDs that can be requested
753
 
 * with #pj_exception_id_alloc(). For each entry, a small record will
754
 
 * be allocated in the .bss segment.
755
 
 *
756
 
 * Default: 16
757
 
 */
758
 
#ifndef PJ_MAX_EXCEPTION_ID
759
 
#   define PJ_MAX_EXCEPTION_ID      16
760
 
#endif
761
 
 
762
 
/**
763
 
 * Should we use Windows Structured Exception Handling (SEH) for the
764
 
 * PJLIB exceptions.
765
 
 *
766
 
 * Default: 0
767
 
 */
768
 
#ifndef PJ_EXCEPTION_USE_WIN32_SEH
769
 
#  define PJ_EXCEPTION_USE_WIN32_SEH 0
770
 
#endif
771
 
 
772
 
/**
773
 
 * Should we attempt to use Pentium's rdtsc for high resolution
774
 
 * timestamp.
775
 
 *
776
 
 * Default: 0
777
 
 */
778
 
#ifndef PJ_TIMESTAMP_USE_RDTSC
779
 
#   define PJ_TIMESTAMP_USE_RDTSC   0
780
 
#endif
781
 
 
782
 
/**
783
 
 * Is native platform error positive number?
784
 
 * Default: 1 (yes)
785
 
 */
786
 
#ifndef PJ_NATIVE_ERR_POSITIVE
787
 
#   define PJ_NATIVE_ERR_POSITIVE   1
788
 
#endif
789
 
 
790
 
/**
791
 
 * Include error message string in the library (pj_strerror()).
792
 
 * This is very much desirable!
793
 
 *
794
 
 * Default: 1
795
 
 */
796
 
#ifndef PJ_HAS_ERROR_STRING
797
 
#   define PJ_HAS_ERROR_STRING      1
798
 
#endif
799
 
 
800
 
 
801
 
/**
802
 
 * Include pj_stricmp_alnum() and pj_strnicmp_alnum(), i.e. custom
803
 
 * functions to compare alnum strings. On some systems, they're faster
804
 
 * then stricmp/strcasecmp, but they can be slower on other systems.
805
 
 * When disabled, pjlib will fallback to stricmp/strnicmp.
806
 
 * 
807
 
 * Default: 0
808
 
 */
809
 
#ifndef PJ_HAS_STRICMP_ALNUM
810
 
#   define PJ_HAS_STRICMP_ALNUM     0
811
 
#endif
812
 
 
813
 
 
814
 
/*
815
 
 * Types of QoS backend implementation.
816
 
 */
817
 
 
818
 
/** 
819
 
 * Dummy QoS backend implementation, will always return error on all
820
 
 * the APIs.
821
 
 */
822
 
#define PJ_QOS_DUMMY        1
823
 
 
824
 
/** QoS backend based on setsockopt(IP_TOS) */
825
 
#define PJ_QOS_BSD          2
826
 
 
827
 
/** QoS backend for Windows Mobile 6 */
828
 
#define PJ_QOS_WM           3
829
 
 
830
 
/** QoS backend for Symbian */
831
 
#define PJ_QOS_SYMBIAN      4
832
 
 
833
 
/**
834
 
 * Force the use of some QoS backend API for some platforms.
835
 
 */
836
 
#ifndef PJ_QOS_IMPLEMENTATION
837
 
#   if defined(PJ_WIN32_WINCE) && PJ_WIN32_WINCE && _WIN32_WCE >= 0x502
838
 
        /* Windows Mobile 6 or later */
839
 
#       define PJ_QOS_IMPLEMENTATION    PJ_QOS_WM
840
 
#   endif
841
 
#endif
842
 
 
843
 
 
844
 
/**
845
 
 * Enable secure socket. For most platforms, this is implemented using
846
 
 * OpenSSL, so this will require OpenSSL to be installed. For Symbian
847
 
 * platform, this is implemented natively using CSecureSocket.
848
 
 *
849
 
 * Default: 0 (for now)
850
 
 */
851
 
#ifndef PJ_HAS_SSL_SOCK
852
 
#  define PJ_HAS_SSL_SOCK           0
853
 
#endif
854
 
 
855
 
 
856
 
/**
857
 
 * Disable WSAECONNRESET error for UDP sockets on Win32 platforms. See
858
 
 * https://trac.pjsip.org/repos/ticket/1197.
859
 
 *
860
 
 * Default: 1
861
 
 */
862
 
#ifndef PJ_SOCK_DISABLE_WSAECONNRESET
863
 
#   define PJ_SOCK_DISABLE_WSAECONNRESET    1
864
 
#endif
865
 
 
866
 
 
867
 
/** @} */
868
 
 
869
 
/********************************************************************
870
 
 * General macros.
871
 
 */
872
 
 
873
 
/**
874
 
 * @defgroup pj_dll_target Building Dynamic Link Libraries (DLL/DSO)
875
 
 * @ingroup pj_config
876
 
 * @{
877
 
 *
878
 
 * The libraries support generation of dynamic link libraries for
879
 
 * Symbian ABIv2 target (.dso/Dynamic Shared Object files, in Symbian
880
 
 * terms). Similar procedures may be applied for Win32 DLL with some 
881
 
 * modification.
882
 
 *
883
 
 * Depending on the platforms, these steps may be necessary in order to
884
 
 * produce the dynamic libraries:
885
 
 *  - Create the (Visual Studio) projects to produce DLL output. PJLIB
886
 
 *    does not provide ready to use project files to produce DLL, so
887
 
 *    you need to create these projects yourself. For Symbian, the MMP
888
 
 *    files have been setup to produce DSO files for targets that 
889
 
 *    require them.
890
 
 *  - In the (Visual Studio) projects, some macros need to be declared
891
 
 *    so that appropriate modifiers are added to symbol declarations
892
 
 *    and definitions. Please see the macro section below for information
893
 
 *    regarding these macros. For Symbian, these have been taken care by the
894
 
 *    MMP files.
895
 
 *  - Some build systems require .DEF file to be specified when creating
896
 
 *    the DLL. For Symbian, .DEF files are included in pjlib distribution,
897
 
 *    in <tt>pjlib/build.symbian</tt> directory. These DEF files are 
898
 
 *    created by running <tt>./makedef.sh all</tt> from this directory,
899
 
 *    inside Mingw.
900
 
 *
901
 
 * Macros related for building DLL/DSO files:
902
 
 *  - For platforms that supports dynamic link libraries generation,
903
 
 *    it must declare <tt>PJ_EXPORT_SPECIFIER</tt> macro which value contains
904
 
 *    the prefix to be added to symbol definition, to export this 
905
 
 *    symbol in the DLL/DSO. For example, on Win32/Visual Studio, the
906
 
 *    value of this macro is \a __declspec(dllexport), and for ARM 
907
 
 *    ABIv2/Symbian, the value is \a EXPORT_C. 
908
 
 *  - For platforms that supports linking with dynamic link libraries,
909
 
 *    it must declare <tt>PJ_IMPORT_SPECIFIER</tt> macro which value contains
910
 
 *    the prefix to be added to symbol declaration, to import this 
911
 
 *    symbol from a DLL/DSO. For example, on Win32/Visual Studio, the
912
 
 *    value of this macro is \a __declspec(dllimport), and for ARM 
913
 
 *    ABIv2/Symbian, the value is \a IMPORT_C. 
914
 
 *  - Both <tt>PJ_EXPORT_SPECIFIER</tt> and <tt>PJ_IMPORT_SPECIFIER</tt> 
915
 
 *    macros above can be declared in your \a config_site.h if they are not
916
 
 *    declared by pjlib.
917
 
 *  - When PJLIB is built as DLL/DSO, both <tt>PJ_DLL</tt> and 
918
 
 *    <tt>PJ_EXPORTING</tt> macros must be declared, so that 
919
 
 *     <tt>PJ_EXPORT_SPECIFIER</tt> modifier will be added into function
920
 
 *    definition.
921
 
 *  - When application wants to link dynamically with PJLIB, then it
922
 
 *    must declare <tt>PJ_DLL</tt> macro when using/including PJLIB header,
923
 
 *    so that <tt>PJ_IMPORT_SPECIFIER</tt> modifier is properly added into 
924
 
 *    symbol declarations.
925
 
 *
926
 
 * When <b>PJ_DLL</b> macro is not declared, static linking is assumed.
927
 
 *
928
 
 * For example, here are some settings to produce DLLs with Visual Studio
929
 
 * on Windows/Win32:
930
 
 *  - Create Visual Studio projects to produce DLL. Add the appropriate 
931
 
 *    project dependencies to avoid link errors.
932
 
 *  - In the projects, declare <tt>PJ_DLL</tt> and <tt>PJ_EXPORTING</tt> 
933
 
 *    macros.
934
 
 *  - Declare these macros in your <tt>config_site.h</tt>:
935
 
 \verbatim
936
 
        #define PJ_EXPORT_SPECIFIER  __declspec(dllexport)
937
 
        #define PJ_IMPORT_SPECIFIER  __declspec(dllimport)
938
 
 \endverbatim
939
 
 *  - And in the application (that links with the DLL) project, add 
940
 
 *    <tt>PJ_DLL</tt> in the macro declarations.
941
 
 */
942
 
 
943
 
/** @} */
944
 
 
945
 
/**
946
 
 * @defgroup pj_config Build Configuration
947
 
 * @{
948
 
 */
949
 
 
950
 
/**
951
 
 * @def PJ_INLINE(type)
952
 
 * @param type The return type of the function.
953
 
 * Expand the function as inline.
954
 
 */
955
 
#define PJ_INLINE(type)   PJ_INLINE_SPECIFIER type
956
 
 
957
 
/**
958
 
 * This macro declares platform/compiler specific specifier prefix
959
 
 * to be added to symbol declaration to export the symbol when PJLIB
960
 
 * is built as dynamic library.
961
 
 *
962
 
 * This macro should have been added by platform specific headers,
963
 
 * if the platform supports building dynamic library target. 
964
 
 */
965
 
#ifndef PJ_EXPORT_DECL_SPECIFIER
966
 
#   define PJ_EXPORT_DECL_SPECIFIER
967
 
#endif
968
 
 
969
 
 
970
 
/**
971
 
 * This macro declares platform/compiler specific specifier prefix
972
 
 * to be added to symbol definition to export the symbol when PJLIB
973
 
 * is built as dynamic library.
974
 
 *
975
 
 * This macro should have been added by platform specific headers,
976
 
 * if the platform supports building dynamic library target. 
977
 
 */
978
 
#ifndef PJ_EXPORT_DEF_SPECIFIER
979
 
#   define PJ_EXPORT_DEF_SPECIFIER
980
 
#endif
981
 
 
982
 
 
983
 
/**
984
 
 * This macro declares platform/compiler specific specifier prefix
985
 
 * to be added to symbol declaration to import the symbol.
986
 
 *
987
 
 * This macro should have been added by platform specific headers,
988
 
 * if the platform supports building dynamic library target.
989
 
 */
990
 
#ifndef PJ_IMPORT_DECL_SPECIFIER
991
 
#   define PJ_IMPORT_DECL_SPECIFIER
992
 
#endif
993
 
 
994
 
 
995
 
/**
996
 
 * This macro has been deprecated. It will evaluate to nothing.
997
 
 */
998
 
#ifndef PJ_EXPORT_SYMBOL
999
 
#   define PJ_EXPORT_SYMBOL(x)
1000
 
#endif
1001
 
 
1002
 
 
1003
 
/**
1004
 
 * @def PJ_DECL(type)
1005
 
 * @param type The return type of the function.
1006
 
 * Declare a function.
1007
 
 */
1008
 
#if defined(PJ_DLL)
1009
 
#   if defined(PJ_EXPORTING)
1010
 
#       define PJ_DECL(type)        PJ_EXPORT_DECL_SPECIFIER type
1011
 
#   else
1012
 
#       define PJ_DECL(type)        PJ_IMPORT_DECL_SPECIFIER type
1013
 
#   endif
1014
 
#elif !defined(PJ_DECL)
1015
 
#   if defined(__cplusplus)
1016
 
#       define PJ_DECL(type)        type
1017
 
#   else
1018
 
#       define PJ_DECL(type)        extern type
1019
 
#   endif
1020
 
#endif
1021
 
 
1022
 
 
1023
 
/**
1024
 
 * @def PJ_DEF(type)
1025
 
 * @param type The return type of the function.
1026
 
 * Define a function.
1027
 
 */
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
1032
 
#endif
1033
 
 
1034
 
 
1035
 
/**
1036
 
 * @def PJ_DECL_NO_RETURN(type)
1037
 
 * @param type The return type of the function.
1038
 
 * Declare a function that will not return.
1039
 
 */
1040
 
/**
1041
 
 * @def PJ_IDECL_NO_RETURN(type)
1042
 
 * @param type The return type of the function.
1043
 
 * Declare an inline function that will not return.
1044
 
 */
1045
 
/**
1046
 
 * @def PJ_BEGIN_DECL
1047
 
 * Mark beginning of declaration section in a header file.
1048
 
 */
1049
 
/**
1050
 
 * @def PJ_END_DECL
1051
 
 * Mark end of declaration section in a header file.
1052
 
 */
1053
 
#ifdef __cplusplus
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               }
1058
 
#else
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
1063
 
#endif
1064
 
 
1065
 
 
1066
 
 
1067
 
/**
1068
 
 * @def PJ_DECL_DATA(type)
1069
 
 * @param type The data type.
1070
 
 * Declare a global data.
1071
 
 */ 
1072
 
#if defined(PJ_DLL)
1073
 
#   if defined(PJ_EXPORTING)
1074
 
#       define PJ_DECL_DATA(type)   PJ_EXPORT_DECL_SPECIFIER extern type
1075
 
#   else
1076
 
#       define PJ_DECL_DATA(type)   PJ_IMPORT_DECL_SPECIFIER extern type
1077
 
#   endif
1078
 
#elif !defined(PJ_DECL_DATA)
1079
 
#   define PJ_DECL_DATA(type)       extern type
1080
 
#endif
1081
 
 
1082
 
 
1083
 
/**
1084
 
 * @def PJ_DEF_DATA(type)
1085
 
 * @param type The data type.
1086
 
 * Define a global data.
1087
 
 */ 
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
1092
 
#endif
1093
 
 
1094
 
 
1095
 
/**
1096
 
 * @def PJ_IDECL(type)
1097
 
 * @param type  The function's return type.
1098
 
 * Declare a function that may be expanded as inline.
1099
 
 */
1100
 
/**
1101
 
 * @def PJ_IDEF(type)
1102
 
 * @param type  The function's return type.
1103
 
 * Define a function that may be expanded as inline.
1104
 
 */
1105
 
 
1106
 
#if PJ_FUNCTIONS_ARE_INLINED
1107
 
#  define PJ_IDECL(type)  PJ_INLINE(type)
1108
 
#  define PJ_IDEF(type)   PJ_INLINE(type)
1109
 
#else
1110
 
#  define PJ_IDECL(type)  PJ_DECL(type)
1111
 
#  define PJ_IDEF(type)   PJ_DEF(type)
1112
 
#endif
1113
 
 
1114
 
 
1115
 
/**
1116
 
 * @def PJ_UNUSED_ARG(arg)
1117
 
 * @param arg   The argument name.
1118
 
 * PJ_UNUSED_ARG prevents warning about unused argument in a function.
1119
 
 */
1120
 
#define PJ_UNUSED_ARG(arg)  (void)arg
1121
 
 
1122
 
/**
1123
 
 * @def PJ_TODO(id)
1124
 
 * @param id    Any identifier that will be printed as TODO message.
1125
 
 * PJ_TODO macro will display TODO message as warning during compilation.
1126
 
 * Example: PJ_TODO(CLEAN_UP_ERROR);
1127
 
 */
1128
 
#ifndef PJ_TODO
1129
 
#  define PJ_TODO(id)       TODO___##id:
1130
 
#endif
1131
 
 
1132
 
/**
1133
 
 * Simulate race condition by sleeping the thread in strategic locations.
1134
 
 * Default: no!
1135
 
 */
1136
 
#ifndef PJ_RACE_ME
1137
 
#  define PJ_RACE_ME(x)
1138
 
#endif
1139
 
 
1140
 
/**
1141
 
 * Function attributes to inform that the function may throw exception.
1142
 
 *
1143
 
 * @param x     The exception list, enclosed in parenthesis.
1144
 
 */
1145
 
#define __pj_throw__(x)
1146
 
 
1147
 
/** @} */
1148
 
 
1149
 
/********************************************************************
1150
 
 * Sanity Checks
1151
 
 */
1152
 
#ifndef PJ_HAS_HIGH_RES_TIMER
1153
 
#  error "PJ_HAS_HIGH_RES_TIMER is not defined!"
1154
 
#endif
1155
 
 
1156
 
#if !defined(PJ_HAS_PENTIUM)
1157
 
#  error "PJ_HAS_PENTIUM is not defined!"
1158
 
#endif
1159
 
 
1160
 
#if !defined(PJ_IS_LITTLE_ENDIAN)
1161
 
#  error "PJ_IS_LITTLE_ENDIAN is not defined!"
1162
 
#endif
1163
 
 
1164
 
#if !defined(PJ_IS_BIG_ENDIAN)
1165
 
#  error "PJ_IS_BIG_ENDIAN is not defined!"
1166
 
#endif
1167
 
 
1168
 
#if !defined(PJ_EMULATE_RWMUTEX)
1169
 
#  error "PJ_EMULATE_RWMUTEX should be defined in compat/os_xx.h"
1170
 
#endif
1171
 
 
1172
 
#if !defined(PJ_THREAD_SET_STACK_SIZE)
1173
 
#  error "PJ_THREAD_SET_STACK_SIZE should be defined in compat/os_xx.h"
1174
 
#endif
1175
 
 
1176
 
#if !defined(PJ_THREAD_ALLOCATE_STACK)
1177
 
#  error "PJ_THREAD_ALLOCATE_STACK should be defined in compat/os_xx.h"
1178
 
#endif
1179
 
 
1180
 
PJ_BEGIN_DECL
1181
 
 
1182
 
/** PJLIB version major number. */
1183
 
#define PJ_VERSION_NUM_MAJOR    2
1184
 
 
1185
 
/** PJLIB version minor number. */
1186
 
#define PJ_VERSION_NUM_MINOR    1
1187
 
 
1188
 
/** PJLIB version revision number. */
1189
 
#define PJ_VERSION_NUM_REV      0
1190
 
 
1191
 
/**
1192
 
 * Extra suffix for the version (e.g. "-trunk"), or empty for
1193
 
 * web release version.
1194
 
 */
1195
 
#define PJ_VERSION_NUM_EXTRA    ""
1196
 
 
1197
 
/**
1198
 
 * PJLIB version number consists of three bytes with the following format:
1199
 
 * 0xMMIIRR00, where MM: major number, II: minor number, RR: revision
1200
 
 * number, 00: always zero for now.
1201
 
 */
1202
 
#define PJ_VERSION_NUM  ((PJ_VERSION_NUM_MAJOR << 24) | \
1203
 
                         (PJ_VERSION_NUM_MINOR << 16) | \
1204
 
                         (PJ_VERSION_NUM_REV << 8))
1205
 
 
1206
 
/**
1207
 
 * PJLIB version string constant. @see pj_get_version()
1208
 
 */
1209
 
PJ_DECL_DATA(const char*) PJ_VERSION;
1210
 
 
1211
 
/**
1212
 
 * Get PJLIB version string.
1213
 
 *
1214
 
 * @return #PJ_VERSION constant.
1215
 
 */
1216
 
PJ_DECL(const char*) pj_get_version(void);
1217
 
 
1218
 
/**
1219
 
 * Dump configuration to log with verbosity equal to info(3).
1220
 
 */
1221
 
PJ_DECL(void) pj_dump_config(void);
1222
 
 
1223
 
PJ_END_DECL
1224
 
 
1225
 
 
1226
 
#endif  /* __PJ_CONFIG_H__ */
1227