00001
00002
00003
00004 #ifndef CCXX_CONFIG_H_
00005 #define CCXX_CONFIG_H_
00006 #define __DLL
00007 #define __EXPORT
00008 #define __DLLRTL
00009 #define __EXPORT_TEMPLATE(x)
00010
00011 #define CCXX_EMPTY
00012 #define CCXX_CLASS_EXPORT __EXPORT
00013
00014 #define COMMON_64_CLEAN
00015 #define COMMON_ASYNC_OVERRIDE
00016 #define COMMON_OST_NAMESPACE
00017 #define COMMON_THREAD_SLEEP
00018 #define COMMON_NET_DEVICES
00019 #define COMMON_THREAD_DEBUG
00020 #define COMMON_DEADLOCK_DEBUG
00021 #define COMMON_NAMED_MUTEX
00022 #define COMMON_PROCESS_ATTACH
00023 #define COMMON_XML_PARSING
00024 #define COMMON_TIMER_SLEEP
00025
00026 #if __GNUC__ > 1 && !defined(__STRICT_ANSI__) && !defined(__PEDANTIC__)
00027 #define DYNAMIC_LOCAL_ARRAYS
00028 #endif
00029
00030 #if defined(__CYGWIN__)
00031 #define _POSIX_REALTIME_SIGNALS
00032 #define _POSIX_THREADS
00033 #endif
00034
00035 #if defined(__APPLE__) && defined(__MACH__)
00036 #ifndef MACOSX
00037 #define MACOSX
00038 #define _P1003_1B_VISIBLE
00039 #endif
00040 #ifndef _PTHREADS
00041 #define _PTHREADS 1
00042 #endif
00043 #endif
00044
00045 #if defined(__FreeBSD__)
00046 #ifndef __BSD_VISIBLE
00047 #define __BSD_VISIBLE 1
00048 #endif
00049 #endif
00050
00051 #ifdef _AIX
00052 #ifndef _ALL_SOURCE
00053 #define _ALL_SOURCE
00054 #endif
00055 #endif
00056
00057 #ifdef __hpux
00058 #ifndef _XOPEN_SOURCE_EXTENDED
00059 #define _XOPEN_SOURCE_EXTENDED
00060 #endif
00061 #ifndef _INCLUDE_LONGLONG
00062 #define _INCLUDE_LONGLONG
00063 #endif
00064 #endif
00065
00066 #define CCXX_PACKING
00067 #if defined(__GNUC__)
00068 #define CCXX_PACKED
00069 #elif !defined(__hpux) && !defined(_AIX)
00070 #define CCXX_PACKED
00071 #endif
00072
00073 #if defined(__sun) || defined(__SUN__)
00074 #define __EXTENSIONS__ 1
00075 #endif
00076
00077 #ifndef _REENTRANT
00078 #define _REENTRANT 1
00079 #endif
00080
00081 #ifndef _THREAD_SAFE
00082 #define _THREAD_SAFE 1
00083 #endif
00084
00085 #ifndef _GNU_SOURCE
00086 #define _GNU_SOURCE 1
00087 #endif
00088
00089 #if !defined(_XOPEN_SOURCE) && !defined(__FreeBSD__) &&!defined(__OpenBSD__) && !defined(__MACH__) && !defined(__NetBSD__)
00090 #define _XOPEN_SOURCE 600
00091 #endif
00092
00093
00094
00095
00096
00097
00098 #define HAVE_UNISTD_H 1
00099 #define HAVE_FEATURES_H 1
00100 #define HAVE_SYS_TYPES_H 1
00101
00102 #ifdef HAVE_UNISTD_H
00103 #include <unistd.h>
00104 #endif
00105
00106 #ifndef WIN32
00107 #ifdef HAVE_FEATURES_H
00108 #include <features.h>
00109 #endif
00110 #endif
00111
00112 #ifdef HAVE_SYS_TYPES_H
00113 #include <sys/types.h>
00114 #endif
00115
00116
00117
00118 #define HAVE_SYS_TIME_H 1
00119 #define TIME_WITH_SYS_TIME 1
00120 #if TIME_WITH_SYS_TIME
00121 #include <sys/time.h>
00122 #else
00123 #if HAVE_SYS_TIME_H
00124 #include <sys/time.h>
00125 #endif
00126 #endif
00127
00128
00129
00130
00131 #define HAVE_SYS_TYPES_STD 1
00132 #define HAVE_SYS_TYPES_64 1
00133 #define HAVE_LONG_LONG 1
00134
00135
00136 #ifdef HAVE_SYS_TYPES_H
00137 #include <sys/types.h>
00138 #endif
00139
00140 #ifdef HAVE_BITS_WORSIZE_H
00141 #include <bits/wordtypes.h>
00142 #endif
00143
00144 #ifdef HAVE_SYS_TYPES_STD
00145 typedef int8_t int8;
00146 typedef u_int8_t uint8;
00147 typedef int16_t int16;
00148 typedef u_int16_t uint16;
00149 typedef int32_t int32;
00150 typedef u_int32_t uint32;
00151 #ifdef HAVE_SYS_TYPES_64
00152 #define HAVE_64_BITS
00153 typedef int64_t int64;
00154 typedef u_int64_t uint64;
00155 #endif
00156 #else
00157 typedef char int8;
00158 typedef unsigned char uint8;
00159 typedef short int16;
00160 typedef unsigned short uint16;
00161 typedef int int32;
00162 typedef unsigned int uint32;
00163 #endif
00164
00165 #ifndef HAVE_SYS_TYPES_64
00166 #if defined(__WORDSIZE) || defined(__arch64__)
00167 #if __WORDSIZE >= 64 || defined(__arch64__)
00168 typedef long int int64;
00169 typedef unsigned long int uint64;
00170 #define HAVE_SYS_TYPES_64
00171 #define HAVE_64_BITS
00172 #endif
00173 #endif
00174 #endif
00175
00176 #ifndef HAVE_SYS_TYPES_64
00177 #ifdef __GNUC__
00178 #if defined(HAVE_LONG_LONG) || defined(_LONGLONG)
00179 __extension__
00180 typedef long long int int64;
00181 __extension__
00182 typedef unsigned long long int uint64;
00183 #define HAVE_SYS_TYPES_64
00184 #define HAVE_64_BITS
00185 #endif
00186 #endif
00187 #endif
00188
00189 #ifndef HAVE_SYS_TYPES_64
00190 #if defined(HAVE_LONG_LONG) || defined(_LONGLONG)
00191 #define HAVE_64_BITS
00192 typedef long long int64;
00193 typedef unsigned long long uint64;
00194 #endif
00195 #endif
00196
00197
00198
00199 #define CCXX_EXCEPTIONS 1
00200
00201
00202
00203
00204
00205 #define CCXX_HAVE_NEW_INIT 1
00206
00207
00208 #define CCXX_NAMESPACES 1
00209
00210
00211 #define CCXX_NAT 1
00212
00213
00214
00215
00216
00217
00218
00219
00220
00221
00222
00223
00224
00225
00226
00227
00228
00229 #define ETC_CONFDIR "/usr/etc/"
00230
00231
00232
00233
00234
00235 #define HAVE_ALLOCA_H 1
00236
00237
00238 #define HAVE_ARPA_INET_H 1
00239
00240
00241
00242
00243
00244 #define HAVE_BITS_ATOMICITY_H 1
00245
00246
00247 #define HAVE_BITS_WORDSIZE_H 1
00248
00249
00250 #define HAVE_BOOL_TYPE 1
00251
00252
00253
00254
00255
00256
00257
00258
00259 #define HAVE_DLFCN_H 1
00260
00261
00262 #define HAVE_ENDIAN_H 1
00263
00264
00265 #define HAVE_ERRNO_H 1
00266
00267
00268 #define HAVE_EXCEPTION 1
00269
00270
00271 #define HAVE_EXTRAS 1
00272
00273
00274 #define HAVE_FCNTL_H 1
00275
00276
00277 #define HAVE_FEATURES_H 1
00278
00279
00280
00281
00282
00283 #define HAVE_GCC_CXX_BITS_ATOMIC 1
00284
00285
00286 #define HAVE_GETADDRINFO 1
00287
00288
00289 #define HAVE_GETGRNAM_R 1
00290
00291
00292 #define HAVE_GETHOSTBYNAME2 1
00293
00294
00295 #define HAVE_GETOPT 1
00296
00297
00298 #define HAVE_GETOPT_H 1
00299
00300
00301 #define HAVE_GETOPT_LONG 1
00302
00303
00304 #define HAVE_GETPAGESIZE 1
00305
00306
00307 #define HAVE_GETPWNAM_R 1
00308
00309
00310 #define HAVE_GETPWUID_R 1
00311
00312
00313 #define HAVE_GETTIMEOFDAY 1
00314
00315
00316 #define HAVE_HIRES_TIMER 1
00317
00318
00319 #define HAVE_INET_ATON 1
00320
00321
00322 #define HAVE_INET_PTON 1
00323
00324
00325 #define HAVE_INET_SOCKETS 1
00326
00327
00328 #define HAVE_INTTYPES_H 1
00329
00330
00331
00332
00333
00334
00335
00336
00337
00338
00339
00340
00341
00342
00343
00344
00345
00346
00347
00348
00349 #define HAVE_LIMITS_H 1
00350
00351
00352 #define HAVE_LINUX_IN6_H 1
00353
00354
00355 #define HAVE_LINUX_NETFILTER_IPV4_H 1
00356
00357
00358 #define HAVE_LINUX_NETFILTER_IPV6_H 1
00359
00360
00361 #define HAVE_LOCALTIME_R 1
00362
00363
00364 #define HAVE_LOCKF 1
00365
00366
00367 #define HAVE_LONG_LONG 1
00368
00369
00370 #define HAVE_LSTAT 1
00371
00372
00373
00374
00375
00376
00377
00378
00379 #define HAVE_MEMMOVE 1
00380
00381
00382 #define HAVE_MEMORY_H 1
00383
00384
00385 #define HAVE_MLOCK 1
00386
00387
00388 #define HAVE_MLOCKALL 1
00389
00390
00391 #define HAVE_MODULES 1
00392
00393
00394
00395
00396
00397 #define HAVE_NAT_NETFILTER 1
00398
00399
00400
00401
00402
00403
00404
00405
00406
00407
00408
00409 #define HAVE_NETINET_IN_H 1
00410
00411
00412 #define HAVE_NETINET_IN_SYSTM_H 1
00413
00414
00415
00416
00417
00418
00419
00420
00421
00422
00423
00424 #define HAVE_NETINET_IP_H 1
00425
00426
00427
00428
00429
00430 #define HAVE_NET_IF_H 1
00431
00432
00433
00434
00435
00436
00437
00438
00439 #define HAVE_POLL 1
00440
00441
00442 #define HAVE_POLL_H 1
00443
00444
00445 #define HAVE_POSIX_MEMALIGN 1
00446
00447
00448 #define HAVE_PREAD_PWRITE 1
00449
00450
00451 #define HAVE_PTHREAD_ATTR_SETSTACKSIZE 1
00452
00453
00454 #define HAVE_PTHREAD_CANCEL 1
00455
00456
00457
00458
00459
00460 #define HAVE_PTHREAD_H 1
00461
00462
00463
00464
00465
00466
00467
00468
00469 #define HAVE_PTHREAD_MUTEXATTR_SETTYPE 1
00470
00471
00472
00473
00474
00475 #define HAVE_PTHREAD_NANOSLEEP 1
00476
00477
00478
00479
00480
00481 #define HAVE_PTHREAD_RWLOCK 1
00482
00483
00484
00485
00486
00487
00488
00489
00490 #define HAVE_PTHREAD_SETCANCELTYPE 1
00491
00492
00493
00494
00495
00496 #define HAVE_PTHREAD_YIELD 1
00497
00498
00499
00500
00501
00502 #define HAVE_READDIR_R 1
00503
00504
00505 #define HAVE_REALPATH 1
00506
00507
00508 #define HAVE_SCHED_GETSCHEDULER 1
00509
00510
00511 #define HAVE_SCHED_H 1
00512
00513
00514
00515
00516
00517 #define HAVE_SEMAPHORE_H 1
00518
00519
00520 #define HAVE_SETEGID 1
00521
00522
00523 #define HAVE_SETENV 1
00524
00525
00526 #define HAVE_SETITIMER 1
00527
00528
00529 #define HAVE_SETPGRP 1
00530
00531
00532
00533
00534
00535 #define HAVE_SIGACTION 1
00536
00537
00538 #define HAVE_SIGWAIT 1
00539
00540
00541 #define HAVE_SIGWAIT2 1
00542
00543
00544 #define HAVE_SNPRINTF 1
00545
00546
00547 #define HAVE_SOCKLEN_T 1
00548
00549
00550 #define HAVE_SSTREAM 1
00551
00552
00553
00554
00555
00556 #define HAVE_STDINT_H 1
00557
00558
00559 #define HAVE_STDLIB_H 1
00560
00561
00562 #define HAVE_STRCASECMP 1
00563
00564
00565 #define HAVE_STRDUP 1
00566
00567
00568 #define HAVE_STRERROR_R 1
00569
00570
00571 #define HAVE_STRINGS_H 1
00572
00573
00574 #define HAVE_STRING_H 1
00575
00576
00577 #define HAVE_STRTOK_R 1
00578
00579
00580 #define HAVE_SYSLOG_H 1
00581
00582
00583
00584
00585
00586
00587
00588
00589
00590
00591
00592 #define HAVE_SYS_FCNTL_H 1
00593
00594
00595 #define HAVE_SYS_FILE_H 1
00596
00597
00598 #define HAVE_SYS_IOCTL_H 1
00599
00600
00601
00602
00603
00604
00605
00606
00607 #define HAVE_SYS_PARAM_H 1
00608
00609
00610 #define HAVE_SYS_POLL_H 1
00611
00612
00613
00614
00615
00616 #define HAVE_SYS_SELECT_H 1
00617
00618
00619 #define HAVE_SYS_SOCKET_H 1
00620
00621
00622
00623
00624
00625 #define HAVE_SYS_STAT_H 1
00626
00627
00628
00629
00630
00631 #define HAVE_SYS_TIME_H 1
00632
00633
00634 #define HAVE_SYS_TYPES_64 1
00635
00636
00637 #define HAVE_SYS_TYPES_H 1
00638
00639
00640 #define HAVE_SYS_TYPES_STD 1
00641
00642
00643 #define HAVE_SYS_UN_H 1
00644
00645
00646 #define HAVE_SYS_WAIT_H 1
00647
00648
00649
00650
00651
00652 #define HAVE_UNISTD_H 1
00653
00654
00655 #define HAVE_UNIX_SOCKETS 1
00656
00657
00658 #define HAVE_WAIT4 1
00659
00660
00661 #define HAVE_WAITPID 1
00662
00663
00664
00665
00666
00667
00668
00669
00670
00671
00672
00673 #define HAVE_ZLIB_H 1
00674
00675
00676 #define CCXX_PACKAGE "commoncpp2"
00677
00678
00679 #define CCXX_PACKAGE_BUGREPORT ""
00680
00681
00682 #define CCXX_PACKAGE_NAME ""
00683
00684
00685 #define CCXX_PACKAGE_STRING ""
00686
00687
00688 #define CCXX_PACKAGE_TARNAME ""
00689
00690
00691 #define CCXX_PACKAGE_CCXX_VERSION ""
00692
00693
00694 #define PTHREAD_MUTEXTYPE_RECURSIVE PTHREAD_MUTEX_RECURSIVE_NP
00695
00696
00697 #define RETSIGTYPE void
00698
00699
00700 #define STDC_HEADERS 1
00701
00702
00703 #define TIME_WITH_SYS_TIME 1
00704
00705
00706 #define USE_MONOTONIC_TIMER 1
00707
00708
00709 #define CCXX_VERSION "1.5.4"
00710
00711
00712
00713
00714
00715
00716
00717
00718
00719
00720
00721
00722
00723
00724
00725
00726
00727
00728
00729
00730
00731
00732 #ifndef HAVE_STRERROR_R
00733 #define strerror_r(e, b, l) b = ::strerror(e)
00734 #endif
00735
00736 #ifndef HAVE_GETPWUID_R
00737 #define getpwuid_r(uid, rec, buf, size, ptr) ptr = ::getpwuid(uid)
00738 #define getpwnam_r(name, rec, buf, size, ptr) ptr = ::getpwnam(name)
00739 #endif
00740
00741
00742
00743
00744 #ifdef HAVE_POLL_H
00745 #include <poll.h>
00746 #else
00747 #ifdef HAVE_SYS_POLL_H
00748 #include <sys/poll.h>
00749 #endif
00750 #endif
00751
00752 #if defined(HAVE_POLL) && defined(POLLRDNORM)
00753 #define USE_POLL
00754 #endif
00755
00756
00757
00758
00759
00760 #ifdef HAVE_SYS_LIBCSYS_H
00761 #include <sys/libcsys.h>
00762 #endif
00763
00764 #ifdef HAVE_WINSOCK2_H
00765 #include <winsock2.h>
00766 #else
00767 #ifdef HAVE_WINSOCK_H
00768 #include <winsock.h>
00769 #else
00770 #ifdef HAVE_SYS_SOCKET_H
00771 #include <sys/socket.h>
00772 #ifdef HAVE_SELECT_H
00773 #include <select.h>
00774 #else
00775 #ifdef HAVE_SYS_SELECT_H
00776 #include <sys/select.h>
00777 #endif
00778 #endif
00779
00780 #ifdef HAVE_NETINET_IN_H
00781 #if defined(__hpux) && defined(_XOPEN_SOURCE_EXTENDED)
00782
00783 #endif
00784 #include <netinet/in.h>
00785 #ifdef __hpux
00786 #define _XOPEN_SOURCE_EXTENDED
00787 #endif
00788 #endif
00789 #ifdef HAVE_ARPA_INET_H
00790 #include <arpa/inet.h>
00791 #include <netdb.h>
00792 #endif
00793
00794 #ifdef HAVE_NETINET6_IN6_H
00795 #include <netinet6/in6.h>
00796 #endif
00797
00798 #ifdef HAVE_LINIX_IN6_H
00799 #include <linux/in6.h>
00800 #endif
00801
00802 #ifdef HAVE_NETINET_IN_SYSTM_H
00803 #include <netinet/in_systm.h>
00804 #endif
00805 #ifdef HAVE_NETINET_IP_H
00806 #include <netinet/ip.h>
00807 #endif
00808 #ifdef HAVE_SYS_UN_H
00809 #include <sys/un.h>
00810 #endif
00811 #endif
00812 #endif
00813 #endif
00814
00815 #ifndef HAVE_INET_ATON
00816 #define inet_aton(cp, addr) (((*(unsigned long int *)(addr)) = inet_addr(cp)) != -1)
00817 #endif
00818
00819 #ifndef SUN_LEN
00820 #ifdef SCM_RIGHTS
00821 #define HAVE_UN_LEN
00822 #endif
00823 #ifdef __linux__
00824 #define HAVE_UN_LEN
00825 #endif
00826 #ifdef HAVE_UN_LEN
00827 #define SUN_LEN(ptr) sizeof(sockaddr_un.sun_len) + sizeof(sockaddr_un.sun_family) + sizeof(sockaddr_un.sun_path) + 1
00828 #else
00829 #define SUN_LEN(ptr) ((size_t)((struct sockaddr_un *)0)->sun_path) + strlen((ptr)->sun_path))
00830 #endif
00831 #endif
00832
00833 #ifndef _OSF_SOURCE
00834 #ifndef HAVE_SOCKLEN_T
00835 #if defined(i386) && defined(__svr4__)
00836 #define HAVE_SOCKLEN_U
00837 #else
00838 #if defined(__CYGWIN32__)
00839 #define socklen_t int
00840 #else
00841 typedef int socklen_t;
00842 #endif
00843 #endif
00844
00845 #ifdef HAVE_SOCKLEN_U
00846 #if !defined(__CYGWIN32__) && !defined(__MINGW32__)
00847 typedef unsigned socklen_t;
00848 #else
00849 typedef int socklen_t;
00850 #endif
00851 #endif
00852 #endif
00853 #endif
00854
00855 #ifdef __hpux
00856 #ifdef mutable
00857
00858 #endif
00859 #endif
00860
00861 #if defined(AF_INET6) && defined(HAVE_INET_PTON)
00862 #define CCXX_IPV6
00863 #endif
00864
00865 #define CCXX_MULTIFAMILY_IP
00866
00867
00868
00869
00870 #ifndef HAVE_BOOL_TYPE
00871 typedef enum { true=1, false=0 } bool;
00872 #endif
00873
00874
00875
00876
00877
00878 #ifndef CCXX_EXCEPTIONS
00879
00880 #ifdef HAVE_EXCEPTION
00881 #define HAVE_EXCEPTION 1
00882 #endif
00883
00884 #define THROW(x) abort()
00885
00886 #define THROWS(x)
00887
00888 #define NEW_THROWS
00889 #define THROWS_EMPTY
00890
00891
00892
00893 #else
00894 #define THROW(x) throw x
00895 #define THROWS(x) throw(x)
00896 #define NEW_THROWS throw()
00897 #define THROWS_EMPTY throw()
00898 #endif
00899
00900
00901
00902
00903 #ifdef CCXX_NAMESPACES
00904 #define USING(x) using namespace x;
00905 #else
00906 #define USING(x)
00907 #endif
00908
00909 #ifdef __KCC
00910 #define KAI_NONSTD_IOSTREAM 1
00911 #endif
00912
00913
00914
00915
00916 #ifdef HAVE_SS_H
00917 #include <ss.h>
00918 #define COMMON_SECURE
00919 #endif
00920
00921 #ifndef ETC_PREFIX
00922 #ifdef WIN32
00923 #define ETC_PREFIX "C:\\WINDOWS\\"
00924 #endif
00925
00926 #ifndef ETC_PREFIX
00927 #define ETC_PREFIX "/etc/"
00928 #endif
00929 #endif
00930
00931 #endif
00932
00933
00934
00935
00936
00937 #ifndef HAVE_FCNTL_H
00938 #ifdef HAVE_SYS_FCNTL_H
00939 #include <sys/fcntl.h>
00940 #endif
00941 #else
00942 #include <fcntl.h>
00943 #ifndef O_NDELAY
00944 #ifdef HAVE_SYS_FCNTL_H
00945 #include <sys/fcntl.h>
00946 #endif
00947 #endif
00948 #endif
00949
00950
00951
00952 #if defined(HAVE_ENDIAN_H)
00953 #include <endian.h>
00954 #elif defined(HAVE_SYS_ISA_DEFS_H)
00955 #include <sys/isa_defs.h>
00956 #ifdef _LITTLE_ENDIAN
00957 #define __BYTE_ORDER 1234
00958 #else
00959 #define __BYTE_ORDER 4321
00960 #endif
00961 #if _ALIGNMENT_REQUIRED > 0
00962 #define __BYTE_ALIGNMENT _MAX_ALIGNMENT
00963 #else
00964 #define __BYTE_ALIGNMENT 1
00965 #endif
00966 #endif
00967
00968 #ifndef __LITTLE_ENDIAN
00969 #define __LITTLE_ENDIAN 1234
00970 #define __BIG_ENDIAN 4321
00971 #endif
00972
00973 #ifndef __BYTE_ORDER
00974 #define __BYTE_ORDER 1234
00975 #endif
00976
00977 #ifndef __BYTE_ALIGNMENT
00978 #if defined(SPARC) || defined(sparc)
00979 #if defined(__arch64__) || defined(__sparcv9)
00980 #define __BYTE_ALIGNMENT 8
00981 #else
00982 #define __BYTE_ALIGNMENT 4
00983 #endif
00984 #endif
00985 #endif
00986
00987 #ifndef __BYTE_ALIGNMENT
00988 #define __BYTE_ALIGNMENT 1
00989 #endif
00990
00991
00992
00993
00994 #ifdef HAVE_SIGACTION
00995 #ifdef HAVE_BSD_SIGNAL_H
00996
00997 #endif
00998 #endif
00999
01000
01001
01002
01003
01004 #ifdef HAVE_SIGWAIT2
01005 #ifndef _POSIX_PTHREAD_SEMANTICS
01006 #define _POSIX_PTHREAD_SEMANTICS
01007 #endif
01008 #endif
01009
01010 #ifdef HAVE_BSD_SIGNAL_H
01011 #include <bsd/signal.h>
01012 #else
01013 #include <signal.h>
01014 #endif
01015 #ifndef SA_ONESHOT
01016 #define SA_ONESHOT SA_RESETHAND
01017 #endif
01018
01019
01020
01021
01022 #include <string.h>
01023 #ifdef HAVE_STRINGS_H
01024 #ifndef _AIX
01025 #include <strings.h>
01026 #endif
01027 #endif
01028
01029 #ifdef HAVE_ALLOCA_H
01030 #include <alloca.h>
01031 #endif
01032
01033 #ifndef HAVE_SNPRINTF
01034 #ifdef WIN32
01035 #define snprintf _snprintf
01036 #define vsnprintf _vsnprintf
01037 #endif
01038 #endif
01039
01040 #ifdef HAVE_STRCASECMP
01041 #ifndef stricmp
01042 #define stricmp(x,y) strcasecmp(x,y)
01043 #endif
01044 #ifndef strnicmp
01045 #define strnicmp(x,y,n) strncasecmp(x,y,n)
01046 #endif
01047 #ifndef stristr
01048 #define stristr(x, y) strcasestr(x,y)
01049 #endif
01050 #endif
01051
01052
01053
01054
01055 #ifdef HAVE_THREAD_H
01056 #include "/usr/include/thread.h"
01057 #if defined(i386) && defined(__svr4__) && !defined(__sun)
01058 #define _THR_UNIXWARE
01059 #endif
01060 #if defined(__SVR4) && defined(__sun)
01061 #define _THR_SUNOS5
01062 #else
01063 #if defined(__SVR4__) && defined(__SUN__)
01064 #define _THR_SUNOS5
01065 #endif
01066 #endif
01067 #endif
01068
01069 #ifdef HAVE_WORKING_SYS_ATOMIC_H
01070 #include <sys/atomic.h>
01071 #define HAVE_ATOMIC
01072 #elif defined(HAVE_ATOMIC_AIX)
01073 #include <sys/atomic_op.h>
01074 #ifndef HAVE_ATOMIC
01075 #define HAVE_ATOMIC
01076 #endif
01077 #endif
01078
01079 #if defined(__cplusplus)
01080 #if defined(HAVE_GCC_BITS_ATOMIC) || defined(HAVE_GCC_CXX_BITS_ATOMIC)
01081 #include <bits/atomicity.h>
01082 #define HAVE_ATOMIC
01083 #endif
01084 #endif
01085
01086 #if defined(HAVE_PTHREAD_H) && ( defined(_THREAD_SAFE) || defined(_REENTRANT) )
01087
01088 #ifdef __QNX__
01089 #define __EXT_QNX
01090 #endif
01091
01092 #include <pthread.h>
01093
01094 #ifdef HAVE_PTHREAD_NP_H
01095 #include <pthread_np.h>
01096 #endif
01097
01098 #ifdef HAVE_SEMAPHORE_H
01099 #include <semaphore.h>
01100 #endif
01101 #ifdef _POSIX_PRIORITY_SCHEDULING
01102 #ifdef HAVE_SCHED_H
01103 #include <sched.h>
01104 #else
01105 #ifdef HAVE_SYS_SCHED_H
01106 #include <sys/sched.h>
01107 #endif
01108 #endif
01109 #endif
01110
01111 #define __PTHREAD_H__
01112 #ifndef PTHREAD_MUTEXTYPE_RECURSIVE
01113 #ifdef MUTEX_TYPE_COUNTING_FAST
01114 #define PTHREAD_MUTEXTYPE_RECURSIVE PTHREAD_MUTEX_RECURSIVE_NP
01115 #endif
01116 #endif
01117 #ifndef PTHREAD_MUTEXTYPE_RECURSIVE
01118 #ifdef PTHREAD_MUTEX_RECURSIVE
01119 #define PTHREAD_MUTEXTYPE_RECURSIVE PTHREAD_MUTEX_RECURSIVE_NP
01120 #endif
01121 #endif
01122 #ifndef HAVE_PTHREAD_MUTEXATTR_SETTYPE
01123 #if HAVE_PTHREAD_MUTEXATTR_SETKIND_NP
01124 #ifndef PTHREAD_MUTEXTYPE_RECURSIVE
01125 #define PTHREAD_MUTEXTYPE_RECURSIVE PTHREAD_MUTEX_RECURSIVE_NP
01126 #endif
01127 #define pthread_mutexattr_gettype(x, y) pthread_mutexattr_getkind_np(x, y)
01128 #define pthread_mutexattr_settype(x, y) pthread_mutexattr_setkind_np(x, y)
01129 #endif
01130 #if HAVE_PTHREAD_MUTEXATTR_SETTYPE_NP
01131 #ifndef PTHREAD_MUTEXTYPE_RECURSIVE
01132 #define PTHREAD_MUTEXTYPE_RECURSIVE PTHREAD_MUTEX_RECURSIVE_NP
01133 #endif
01134 #define pthread_mutexattr_settype(x, y) pthread_mutexattr_settype_np(x, y)
01135 #define pthread_mutexattr_gettype(x, y) pthread_mutexattr_gettype_np(x, y)
01136 #endif
01137 #endif
01138
01139 #ifdef HAVE_PTHREAD_MACH_THREAD_NP
01140 #define _THR_MACH
01141 #endif
01142
01143 #ifndef HAVE_PTHREAD_YIELD
01144 #ifdef HAVE_PTHREAD_YIELD_NP
01145 #define pthread_yield() pthread_yield_np()
01146 #define HAVE_PTHREAD_YIELD
01147 #endif
01148 #endif
01149
01150 #ifndef HAVE_PTHREAD_YIELD
01151 #ifdef HAVE_PTHREAD_SCHED_YIELD
01152 #define pthread_yield() sched_yield()
01153 #define HAVE_PTHREAD_YIELD
01154 #endif
01155 #endif
01156
01157 #ifndef HAVE_PTHREAD_DELAY
01158 #ifdef HAVE_PTHREAD_DELAY_NP
01159 #define HAVE_PTHREAD_DELAY
01160 #define pthread_delay(x) pthread_delay_np(x)
01161 #endif
01162 #if defined(HAVE_PTHREAD_NANOSLEEP)
01163 #ifndef HAVE_PTHREAD_DELAY
01164 #define HAVE_PTHREAD_DELAY
01165 #ifdef __FreeBSD__
01166 #ifdef __cplusplus
01167 extern "C" int nanosleep(const struct timespec *rqtp, struct timespec *rmtp);
01168 #endif
01169 #endif
01170 #define pthread_delay(x) nanosleep(x, NULL)
01171 #endif
01172 #endif
01173 #endif
01174
01175 #ifdef HAVE_PTHREAD_ATTR_SETSTACK
01176 #ifndef PTHREAD_STACK_MIN
01177 #define PTHREAD_STACK_MIN 32768
01178 #endif
01179 #endif
01180
01181 #ifndef HAVE_PTHREAD_CANCEL
01182 #ifdef SIGCANCEL
01183 #define CCXX_SIG_THREAD_CANCEL SIGCANCEL
01184 #else
01185 #define CCXX_SIG_THREAD_CANCEL SIGQUIT
01186 #endif
01187 #define pthread_cancel(x) pthread_kill(x, CCXX_SIG_THREAD_CANCEL)
01188 #define pthread_setcanceltype(x, y)
01189 #define pthread_setcancelstate(x, y)
01190 #endif
01191
01192 #ifndef HAVE_PTHREAD_SETCANCELTYPE
01193 #ifdef HAVE_PTHREAD_SETCANCEL
01194 enum
01195 { PTHREAD_CANCEL_ASYNCHRONOUS = CANCEL_ON,
01196 PTHREAD_CANCEL_DEFERRED = CANCEL_OFF};
01197 enum
01198 { PTHREAD_CANCEL_ENABLE = CANCEL_ON,
01199 PTHREAD_CANCEL_DISABLE = CANCEL_OFF};
01200 #define pthread_setcancelstate(x, y) \
01201 (y == NULL) ? pthread_setcancel(x) : *y = pthread_setcancel
01202 #define pthread_setcanceltype(x, y) \
01203 (y == NULL) ? pthread_setasynccancel(x) | *y = pthread_setasynccancel(x)
01204 #else
01205 #define pthread_setcanceltype(x, y)
01206 #define pthread_setcancelstate(x, y)
01207 #endif
01208 #endif
01209
01210 #ifdef _AIX
01211 #ifdef HAVE_PTHREAD_SUSPEND
01212
01213 #endif
01214 #endif
01215
01216 #endif
01217
01218
01219