blob: 7826232f786020266c6292653d137436ab060588 [file] [log] [blame]
Jeff Thompsonf7d49942013-08-01 16:47:40 -07001// (C) Copyright John Maddock 2001 - 2003.
2// (C) Copyright David Abrahams 2002 - 2003.
3// (C) Copyright Aleksey Gurtovoy 2002.
4// Use, modification and distribution are subject to the
5// Boost Software License, Version 1.0. (See accompanying file
6// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
7
8// See http://www.boost.org for most recent version.
9
10// Borland C++ compiler setup:
11
12//
13// versions check:
14// we don't support Borland prior to version 5.4:
15#if __BORLANDC__ < 0x540
16# error "Compiler not supported or configured - please reconfigure"
17#endif
18
19// last known compiler version:
20#if (__BORLANDC__ > 0x613)
Jeff Thompson3d613fd2013-10-15 15:39:04 -070021//# if defined(NDNBOOST_ASSERT_CONFIG)
Jeff Thompsonf7d49942013-08-01 16:47:40 -070022# error "Unknown compiler version - please run the configure tests and report the results"
23//# else
24//# pragma message( "Unknown compiler version - please run the configure tests and report the results")
25//# endif
26#elif (__BORLANDC__ == 0x600)
27# error "CBuilderX preview compiler is no longer supported"
28#endif
29
30//
31// Support macros to help with standard library detection
32#if (__BORLANDC__ < 0x560) || defined(_USE_OLD_RW_STL)
Jeff Thompson3d613fd2013-10-15 15:39:04 -070033# define NDNBOOST_BCB_WITH_ROGUE_WAVE
Jeff Thompsonf7d49942013-08-01 16:47:40 -070034#elif __BORLANDC__ < 0x570
Jeff Thompson3d613fd2013-10-15 15:39:04 -070035# define NDNBOOST_BCB_WITH_STLPORT
Jeff Thompsonf7d49942013-08-01 16:47:40 -070036#else
Jeff Thompson3d613fd2013-10-15 15:39:04 -070037# define NDNBOOST_BCB_WITH_DINKUMWARE
Jeff Thompsonf7d49942013-08-01 16:47:40 -070038#endif
39
40//
41// Version 5.0 and below:
42# if __BORLANDC__ <= 0x0550
43// Borland C++Builder 4 and 5:
Jeff Thompson3d613fd2013-10-15 15:39:04 -070044# define NDNBOOST_NO_MEMBER_TEMPLATE_FRIENDS
Jeff Thompsonf7d49942013-08-01 16:47:40 -070045# if __BORLANDC__ == 0x0550
46// Borland C++Builder 5, command-line compiler 5.5:
Jeff Thompson3d613fd2013-10-15 15:39:04 -070047# define NDNBOOST_NO_OPERATORS_IN_NAMESPACE
Jeff Thompsonf7d49942013-08-01 16:47:40 -070048# endif
49// Variadic macros do not exist for C++ Builder versions 5 and below
Jeff Thompson3d613fd2013-10-15 15:39:04 -070050#define NDNBOOST_NO_CXX11_VARIADIC_MACROS
Jeff Thompsonf7d49942013-08-01 16:47:40 -070051# endif
52
53// Version 5.51 and below:
54#if (__BORLANDC__ <= 0x551)
Jeff Thompson3d613fd2013-10-15 15:39:04 -070055# define NDNBOOST_NO_CV_SPECIALIZATIONS
56# define NDNBOOST_NO_CV_VOID_SPECIALIZATIONS
57# define NDNBOOST_NO_DEDUCED_TYPENAME
Jeff Thompsonf7d49942013-08-01 16:47:40 -070058// workaround for missing WCHAR_MAX/WCHAR_MIN:
59#ifdef __cplusplus
60#include <climits>
61#include <cwchar>
62#else
63#include <limits.h>
64#include <wchar.h>
65#endif // __cplusplus
66#ifndef WCHAR_MAX
67# define WCHAR_MAX 0xffff
68#endif
69#ifndef WCHAR_MIN
70# define WCHAR_MIN 0
71#endif
72#endif
73
74// Borland C++ Builder 6 and below:
75#if (__BORLANDC__ <= 0x564)
76
77# if defined(NDEBUG) && defined(__cplusplus)
78 // fix broken <cstring> so that Boost.test works:
79# include <cstring>
80# undef strcmp
81# endif
82 // fix broken errno declaration:
83# include <errno.h>
84# ifndef errno
85# define errno errno
86# endif
87
88#endif
89
90//
91// new bug in 5.61:
92#if (__BORLANDC__ >= 0x561) && (__BORLANDC__ <= 0x580)
93 // this seems to be needed by the command line compiler, but not the IDE:
Jeff Thompson3d613fd2013-10-15 15:39:04 -070094# define NDNBOOST_NO_MEMBER_FUNCTION_SPECIALIZATIONS
Jeff Thompsonf7d49942013-08-01 16:47:40 -070095#endif
96
97// Borland C++ Builder 2006 Update 2 and below:
98#if (__BORLANDC__ <= 0x582)
Jeff Thompson3d613fd2013-10-15 15:39:04 -070099# define NDNBOOST_NO_SFINAE
100# define NDNBOOST_BCB_PARTIAL_SPECIALIZATION_BUG
101# define NDNBOOST_NO_TEMPLATE_TEMPLATES
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700102
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700103# define NDNBOOST_NO_PRIVATE_IN_AGGREGATE
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700104
105# ifdef _WIN32
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700106# define NDNBOOST_NO_SWPRINTF
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700107# elif defined(linux) || defined(__linux__) || defined(__linux)
108 // we should really be able to do without this
109 // but the wcs* functions aren't imported into std::
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700110# define NDNBOOST_NO_STDC_NAMESPACE
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700111 // _CPPUNWIND doesn't get automatically set for some reason:
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700112# pragma defineonoption NDNBOOST_CPPUNWIND -x
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700113# endif
114#endif
115
116#if (__BORLANDC__ <= 0x613) // Beman has asked Alisdair for more info
117 // we shouldn't really need this - but too many things choke
118 // without it, this needs more investigation:
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700119# define NDNBOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
120# define NDNBOOST_NO_IS_ABSTRACT
121# define NDNBOOST_NO_FUNCTION_TYPE_SPECIALIZATIONS
122# define NDNBOOST_NO_USING_TEMPLATE
123# define NDNBOOST_SP_NO_SP_CONVERTIBLE
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700124
125// Temporary workaround
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700126#define NDNBOOST_MPL_CFG_NO_PREPROCESSED_HEADERS
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700127#endif
128
129// Borland C++ Builder 2008 and below:
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700130# define NDNBOOST_NO_INTEGRAL_INT64_T
131# define NDNBOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL
132# define NDNBOOST_NO_DEPENDENT_NESTED_DERIVATIONS
133# define NDNBOOST_NO_MEMBER_TEMPLATE_FRIENDS
134# define NDNBOOST_NO_TWO_PHASE_NAME_LOOKUP
135# define NDNBOOST_NO_USING_DECLARATION_OVERLOADS_FROM_TYPENAME_BASE
136# define NDNBOOST_NO_NESTED_FRIENDSHIP
137# define NDNBOOST_NO_TYPENAME_WITH_CTOR
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700138#if (__BORLANDC__ < 0x600)
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700139# define NDNBOOST_ILLEGAL_CV_REFERENCES
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700140#endif
141
142//
143// Positive Feature detection
144//
145// Borland C++ Builder 2008 and below:
146#if (__BORLANDC__ >= 0x599)
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700147# pragma defineonoption NDNBOOST_CODEGEAR_0X_SUPPORT -Ax
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700148#endif
149//
150// C++0x Macros:
151//
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700152#if !defined( NDNBOOST_CODEGEAR_0X_SUPPORT ) || (__BORLANDC__ < 0x610)
153# define NDNBOOST_NO_CXX11_CHAR16_T
154# define NDNBOOST_NO_CXX11_CHAR32_T
155# define NDNBOOST_NO_CXX11_DECLTYPE
156# define NDNBOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS
157# define NDNBOOST_NO_CXX11_EXTERN_TEMPLATE
158# define NDNBOOST_NO_CXX11_RVALUE_REFERENCES
159# define NDNBOOST_NO_CXX11_SCOPED_ENUMS
160# define NDNBOOST_NO_CXX11_STATIC_ASSERT
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700161#else
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700162# define NDNBOOST_HAS_ALIGNOF
163# define NDNBOOST_HAS_CHAR16_T
164# define NDNBOOST_HAS_CHAR32_T
165# define NDNBOOST_HAS_DECLTYPE
166# define NDNBOOST_HAS_EXPLICIT_CONVERSION_OPS
167# define NDNBOOST_HAS_REF_QUALIFIER
168# define NDNBOOST_HAS_RVALUE_REFS
169# define NDNBOOST_HAS_STATIC_ASSERT
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700170#endif
171
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700172#define NDNBOOST_NO_CXX11_AUTO_DECLARATIONS
173#define NDNBOOST_NO_CXX11_AUTO_MULTIDECLARATIONS
174#define NDNBOOST_NO_CXX11_CONSTEXPR
175#define NDNBOOST_NO_CXX11_DECLTYPE_N3276
176#define NDNBOOST_NO_CXX11_DEFAULTED_FUNCTIONS
177#define NDNBOOST_NO_CXX11_DELETED_FUNCTIONS
178#define NDNBOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS
179#define NDNBOOST_NO_CXX11_HDR_INITIALIZER_LIST
180#define NDNBOOST_NO_CXX11_LAMBDAS
181#define NDNBOOST_NO_CXX11_LOCAL_CLASS_TEMPLATE_PARAMETERS
182#define NDNBOOST_NO_CXX11_NULLPTR
183#define NDNBOOST_NO_CXX11_RANGE_BASED_FOR
184#define NDNBOOST_NO_CXX11_RAW_LITERALS
185#define NDNBOOST_NO_CXX11_RVALUE_REFERENCES
186#define NDNBOOST_NO_CXX11_SCOPED_ENUMS
187#define NDNBOOST_NO_SFINAE_EXPR
188#define NDNBOOST_NO_CXX11_TEMPLATE_ALIASES
189#define NDNBOOST_NO_CXX11_UNICODE_LITERALS // UTF-8 still not supported
190#define NDNBOOST_NO_CXX11_VARIADIC_TEMPLATES
191#define NDNBOOST_NO_CXX11_NOEXCEPT
192#define NDNBOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX
193#define NDNBOOST_NO_CXX11_USER_DEFINED_LITERALS
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700194
195#if __BORLANDC__ >= 0x590
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700196# define NDNBOOST_HAS_TR1_HASH
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700197
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700198# define NDNBOOST_HAS_MACRO_USE_FACET
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700199#endif
200
201//
202// Post 0x561 we have long long and stdint.h:
203#if __BORLANDC__ >= 0x561
204# ifndef __NO_LONG_LONG
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700205# define NDNBOOST_HAS_LONG_LONG
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700206# else
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700207# define NDNBOOST_NO_LONG_LONG
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700208# endif
209 // On non-Win32 platforms let the platform config figure this out:
210# ifdef _WIN32
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700211# define NDNBOOST_HAS_STDINT_H
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700212# endif
213#endif
214
215// Borland C++Builder 6 defaults to using STLPort. If _USE_OLD_RW_STL is
216// defined, then we have 0x560 or greater with the Rogue Wave implementation
217// which presumably has the std::DBL_MAX bug.
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700218#if defined( NDNBOOST_BCB_WITH_ROGUE_WAVE )
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700219// <climits> is partly broken, some macros define symbols that are really in
220// namespace std, so you end up having to use illegal constructs like
221// std::DBL_MAX, as a fix we'll just include float.h and have done with:
222#include <float.h>
223#endif
224//
225// __int64:
226//
227#if (__BORLANDC__ >= 0x530) && !defined(__STRICT_ANSI__)
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700228# define NDNBOOST_HAS_MS_INT64
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700229#endif
230//
231// check for exception handling support:
232//
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700233#if !defined(_CPPUNWIND) && !defined(NDNBOOST_CPPUNWIND) && !defined(__EXCEPTIONS) && !defined(NDNBOOST_NO_EXCEPTIONS)
234# define NDNBOOST_NO_EXCEPTIONS
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700235#endif
236//
237// all versions have a <dirent.h>:
238//
239#ifndef __STRICT_ANSI__
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700240# define NDNBOOST_HAS_DIRENT_H
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700241#endif
242//
243// all versions support __declspec:
244//
245#if defined(__STRICT_ANSI__)
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700246// config/platform/win32.hpp will define NDNBOOST_SYMBOL_EXPORT, etc., unless already defined
247# define NDNBOOST_SYMBOL_EXPORT
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700248#endif
249//
250// ABI fixing headers:
251//
252#if __BORLANDC__ != 0x600 // not implemented for version 6 compiler yet
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700253#ifndef NDNBOOST_ABI_PREFIX
254# define NDNBOOST_ABI_PREFIX "ndnboost/config/abi/borland_prefix.hpp"
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700255#endif
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700256#ifndef NDNBOOST_ABI_SUFFIX
257# define NDNBOOST_ABI_SUFFIX "ndnboost/config/abi/borland_suffix.hpp"
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700258#endif
259#endif
260//
261// Disable Win32 support in ANSI mode:
262//
263#if __BORLANDC__ < 0x600
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700264# pragma defineonoption NDNBOOST_DISABLE_WIN32 -A
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700265#elif defined(__STRICT_ANSI__)
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700266# define NDNBOOST_DISABLE_WIN32
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700267#endif
268//
269// MSVC compatibility mode does some nasty things:
270// TODO: look up if this doesn't apply to the whole 12xx range
271//
272#if defined(_MSC_VER) && (_MSC_VER <= 1200)
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700273# define NDNBOOST_NO_ARGUMENT_DEPENDENT_LOOKUP
274# define NDNBOOST_NO_VOID_RETURNS
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700275#endif
276
277// Borland did not implement value-initialization completely, as I reported
278// in 2007, Borland Report 51854, "Value-initialization: POD struct should be
279// zero-initialized", http://qc.embarcadero.com/wc/qcmain.aspx?d=51854
280// See also: http://www.boost.org/libs/utility/value_init.htm#compiler_issues
281// (Niels Dekker, LKEB, April 2010)
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700282#define NDNBOOST_NO_COMPLETE_VALUE_INITIALIZATION
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700283
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700284#define NDNBOOST_COMPILER "Borland C++ version " NDNBOOST_STRINGIZE(__BORLANDC__)
Jeff Thompsonf7d49942013-08-01 16:47:40 -0700285
286
287
288