1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214
|
//////////////////////////////////////////////////////////////////
//
// pwlib_compat.h PWLib compatibility header
//
// Copyright (c) 2006-2011, Jan Willamowius
//
// This work is published under the GNU Public License version 2 (GPLv2)
// see file COPYING for details.
// We also explicitly grant the right to link this code
// with the OpenH323/H323Plus and OpenSSL library.
//
//////////////////////////////////////////////////////////////////
#ifndef PWLIB_COMPAT_H
#define PWLIB_COMPAT_H "@(#) $Id: pwlib_compat.h,v 1.51 2011/11/28 12:33:41 willamowius Exp $"
#include "ptbuildopts.h"
#include "openh323buildopts.h"
#include "gnugkbuildopts.h"
// use at least PWLib Pandora
#if PWLIB_MAJOR == 1
#if PWLIB_MINOR < 7
#error "PWLib too old, use at least 1.7.5.2"
#endif
#endif
#ifndef PTRACING
#error "Enable PTRACING in PTLIB to compile GnuGk"
#endif
// check for PConfig support
#ifndef P_CONFIG_FILE
#error "Make sure PTLib has config file support enabled, avoid --disable-configfile or --enable-openh323 or --enable-minsize etc."
#endif
// define PTimedMutex for PWLib < 1.9.2
#if PWLIB_MAJOR == 1
#if PWLIB_MINOR < 9
#define PTimedMutex PMutex
#endif
#endif
#if PWLIB_MAJOR == 1
#if PWLIB_MINOR == 9
#if PWLIB_BUILD < 2
#define PTimedMutex PMutex
#endif
#endif
#endif
// define PWCharArray for PWLib < 2.x.x
#if PTLIB_MAJOR < 2
#define PWCharArray PWORDArray
#endif
#if !defined(P_USE_STANDARD_CXX_BOOL) && !defined(P_USE_INTEGER_BOOL)
typedef int PBoolean;
#endif
#ifdef P_DNS
#define hasSRV 1 // DNS SRV
// define hasRDS for PWLib >= 1.11.3
#if PWLIB_MAJOR == 1
#if PWLIB_MINOR >= 11
#if PWLIB_BUILD > 2
#define hasRDS 1
#endif
#endif
#endif
// define hasSETENUMSERVERS for PWLib >= 1.9.3
#if PWLIB_MAJOR == 1
#if PWLIB_MINOR >= 9
#define hasSETENUMSERVERS 1
#endif
#endif
#endif
// define hasDeletingSetStream for PWLib >= 1.11.2
#if PWLIB_MAJOR == 1
#if PWLIB_MINOR >= 11
#if PWLIB_BUILD >= 2
#define hasDeletingSetStream 1
#endif
#endif
#endif
#if PWLIB_MAJOR == 1
#if PWLIB_MINOR == 12
#define hasRDS 1
#define hasSETENUMSERVERS 1
#endif
#endif
// for PTlib v2.x
#ifdef PTLIB_MAJOR
#define hasRDS 1
#define hasSETENUMSERVERS 1
#define hasDeletingSetStream 1
#endif
#if PTLIB_MAJOR == 2
// changed PConfig interface in PWLib >= 2.2.0
#if PTLIB_MINOR >= 2
#define hasPConfigArray 1
#endif
// availability of GetLastError in PDynaLink
#if PTLIB_MINOR >= 8
#define hasDynaLinkGetLastError 1
#endif
#if PTLIB_MINOR == 9
#define hasPTLibTraceOnShutdownBug 1
#endif
#if PTLIB_MINOR >= 10
#ifdef P_HAS_IPV6
// IPv6 support before 2.10.0 is too buggy
#define hasIPV6 1
#endif
#endif
#if PTLIB_MINOR >= 11
#define hasLDAPStartTLS 1
#define hasNewSTUN 1
#define hasPTRACE2 1
#endif
// bug with no trailing NULL bytes in BMP strings, fixed in PTLib 2.7.1
#if ((PTLIB_MINOR == 2) || (PTLIB_MINOR == 4 && PTLIB_BUILD <= 5) || (PTLIB_MINOR == 5 && PTLIB_BUILD <= 2) || (PTLIB_MINOR == 6 && PTLIB_BUILD <= 4))
#ifdef _WIN32
#pragma message("PTLib with MD5 token bug")
#else
#warning "PTLib with MD5 token bug"
#endif
#endif
#endif
#if !defined(PWLIB_MAJOR) && !defined(PTLIB_MAJOR)
#if _WIN32
#pragma message ("warning: Can't detect PTLib version")
#else
#warning "Can't detect PTLib version"
#endif
// be on the safe side and risk a small memleak instead of a crash
#define hasDeletingSetStream 1
#endif
// store version numver it PT macros for dispaly later on
#if !defined(PTLIB_MAJOR)
#define PTLIB_MAJOR PWLIB_MAJOR
#define PTLIB_MINOR PWLIB_MINOR
#define PTLIB_BUILD PWLIB_BUILD
#endif
///////////////////////////////////////////////
// OpenH323/H323Plus version matching
#ifdef H323_H235
#define HAS_H235_MEDIA 1 // H235 Media Encryption Support
#endif
#ifdef H323_H460
#define HAS_H460 1 // H460 support
#endif
#ifdef HAS_H46023 // config switch if H.460.23 should be enabled
#ifdef H323_H46023 // feature detection, if library supports H.460.23
#ifdef H323_H46024B
#define HAS_H46024B 1
#endif
#endif
#endif
#ifdef H323_H460P
#define HAS_H460P 1 // Presence
#endif
#if OPENH323_MAJOR == 1
#if OPENH323_MINOR == 22
#if OPENH323_BUILD >= 1
#define HAS_ROUTECALLTOMC 1 // H323Plus endpoints supports RouteCallToMC() - starts with 1.22.1
#endif
#endif
#endif
#if OPENH323_MAJOR == 1
#if OPENH323_MINOR > 22
#define HAS_ROUTECALLTOMC 1 // H323Plus endpoints supports RouteCallToMC() - starts inside 1.22.1
#endif
#endif
#if OPENH323_MAJOR == 1
#if OPENH323_MINOR >= 19
#if OPENH323_MINOR == 19
#if OPENH323_BUILD > 0
#define OpenH323Factory 1 // OpenH323 Factory Loader Auth
#endif
#if OPENH323_BUILD > 4
#define h323pluslib 1 // Indicate H323plus Library
#define h323v6 1 // Version 6 features
#endif
#else // h323plus v1.20
#define OpenH323Factory 1 // OpenH323 Factory Loader Auth
#define h323pluslib 1 // Indicate H323plus Library
#define h323v6 1 // Version 6 features
#endif
#endif
#endif
#if defined(hasPTRACE2)
#define PTRACEX(level, args) PTRACE2(level,NULL,args)
#else
#define PTRACEX(level, args) PTRACE(level,args)
#endif
#endif
|