1 /* 2 * 3 * Copyright (c) 1994 4 * Hewlett-Packard Company 5 * 6 * Copyright (c) 1996,1997 7 * Silicon Graphics Computer Systems, Inc. 8 * 9 * Copyright (c) 1997 10 * Moscow Center for SPARC Technology 11 * 12 * Copyright (c) 1999 13 * Boris Fomitchev 14 * 15 * This material is provided "as is", with absolutely no warranty expressed 16 * or implied. Any use is at your own risk. 17 * 18 * Permission to use or copy this software for any purpose is hereby granted 19 * without fee, provided the above notices are retained on all copies. 20 * Permission to modify the code and to distribute modified code is granted, 21 * provided the above notices are retained, and a notice that the code was 22 * modified is included with the above copyright notice. 23 * 24 */ 25 26#ifndef _STLP_FEATURES_H 27#define _STLP_FEATURES_H 28 29/* 30 * Purpose of this file: 31 * 32 * Defines all STLport settings. 33 * This file is actually a wrapper : it includes compiler-specific 34 * settings from <config/stlcomp.h> 35 * and user-defined settings from <config/user_config.h>. 36 * See <config/stl_mycomp.h> and <config/user_config.h> for the description 37 * of those macros 38 * 39 */ 40 41/* Definition of the STLport version informations */ 42#include <stl/_stlport_version.h> 43 44/* Other macros defined by this file: 45 46 * bool, true, and false, if _STLP_NO_BOOL is defined. 47 * typename, as a null macro if it's not already a keyword. 48 * explicit, as a null macro if it's not already a keyword. 49 * namespace-related macros (_STLP_STD, _STLP_BEGIN_NAMESPACE, etc.) 50 * exception-related macros (_STLP_TRY, _STLP_UNWIND, etc.) 51 * _STLP_ASSERT, either as a test or as a null macro, depending on 52 whether or not _STLP_ASSERTIONS is defined. 53*/ 54 55/* Definition of the 2 STLport debug levels */ 56#define _STLP_STLPORT_DBG_LEVEL 1 57#define _STLP_STANDARD_DBG_LEVEL 2 58 59/* Placeholder for user to override settings. 60 * It could be also used to mask settings from 61 * different directories. 62 */ 63#include <stl/config/user_config.h> 64 65#if defined (_STLP_DEBUG) && !defined (_STLP_DEBUG_LEVEL) 66# define _STLP_DEBUG_LEVEL _STLP_STLPORT_DBG_LEVEL 67#endif 68 69#if defined (__BUILDING_STLPORT) 70/* For the STLport implementation we can use everything: 71 */ 72# if defined (_STLP_NO_ANACHRONISMS) 73# undef _STLP_NO_ANACHRONISMS 74# endif 75# if defined (_STLP_NO_EXTENSIONS) 76# undef _STLP_NO_EXTENSIONS 77# endif 78/* Moreover there are things that have no sens: 79 */ 80# if defined (_STLP_NO_IOSTREAMS) 81# error If you do not use iostreams you do not need to build the STLport library. 82# endif 83#endif 84 85/* ========================================================= */ 86/* This file is used for compatibility; it accepts old-style config 87 switches */ 88#include <stl/config/compat.h> 89 90/* Common configuration file for this particular installation. */ 91#include <stl/config/host.h> 92 93/* Operational Environment specific */ 94#include <stl/config/_system.h> 95 96/* ========================================================= */ 97 98/* some fixes to configuration. This also includes modifications 99 * of STLport switches depending on compiler flags, 100 * or settings applicable to a group of compilers, such as 101 * to all who use EDG front-end. 102 */ 103#include <stl/config/stl_confix.h> 104 105#if !defined (_STLP_NO_MEMBER_TEMPLATES) && !defined (_STLP_MEMBER_TEMPLATES) 106# define _STLP_MEMBER_TEMPLATES 1 107#endif 108 109#if !defined (_STLP_NO_MEMBER_TEMPLATE_CLASSES) && !defined (_STLP_MEMBER_TEMPLATE_CLASSES) 110# define _STLP_MEMBER_TEMPLATE_CLASSES 1 111#endif 112 113#if defined (_STLP_NO_MEMBER_TEMPLATE_CLASSES) && !defined (_STLP_DONT_SUPPORT_REBIND_MEMBER_TEMPLATE) 114# define _STLP_DONT_SUPPORT_REBIND_MEMBER_TEMPLATE 1 115#endif 116 117#if !defined (_STLP_NO_CLASS_PARTIAL_SPECIALIZATION) && !defined (_STLP_CLASS_PARTIAL_SPECIALIZATION) 118# define _STLP_CLASS_PARTIAL_SPECIALIZATION 1 119#endif 120 121#if !defined (_STLP_FUNCTION_TMPL_PARTIAL_ORDER) && !defined (_STLP_NO_FUNCTION_TMPL_PARTIAL_ORDER) 122# define _STLP_FUNCTION_TMPL_PARTIAL_ORDER 1 123#endif 124 125#if !defined (_STLP_DONT_USE_SHORT_STRING_OPTIM) && !defined (_STLP_USE_SHORT_STRING_OPTIM) 126# define _STLP_USE_SHORT_STRING_OPTIM 1 127#endif 128 129#if defined (_STLP_MEMBER_TEMPLATES) && !defined (_STLP_NO_EXTENSIONS) && \ 130 !defined (_STLP_NO_CONTAINERS_EXTENSION) && !defined (_STLP_USE_CONTAINERS_EXTENSION) 131# define _STLP_USE_CONTAINERS_EXTENSION 132#endif 133 134#if defined (_STLP_USE_CONTAINERS_EXTENSION) 135# define _STLP_TEMPLATE_FOR_CONT_EXT template <class _KT> 136#else 137# define _STLP_TEMPLATE_FOR_CONT_EXT 138#endif 139 140#if defined (_STLP_USE_PTR_SPECIALIZATIONS) && \ 141 (defined (_STLP_NO_CLASS_PARTIAL_SPECIALIZATION) && defined (_STLP_DONT_SIMULATE_PARTIAL_SPEC_FOR_TYPE_TRAITS)) 142# error Sorry but according the STLport settings your compiler can not support the pointer specialization feature. 143#endif 144 145#if defined (_STLP_WHOLE_NATIVE_STD) && defined (_STLP_NO_OWN_NAMESPACE) 146# error Sorry but asking for both STLport to be in the real std namespace and also having STLport import all native std stuff \ 147 is invalid, chose one or none. 148#endif 149 150#if defined (_STLP_VERBOSE) && !defined (_STLP_VERBOSE_MODE_SUPPORTED) 151# error Sorry but the verbose mode is not implemented for your compiler. 152#endif 153 154#if defined (_STLP_NO_IOSTREAMS) && \ 155 !defined (_STLP_USE_NEWALLOC) && !defined (_STLP_USE_MALLOC) 156# define _STLP_USE_NEWALLOC 157#endif 158 159#if !defined (_STLP_BIG_ENDIAN) && !defined (_STLP_LITTLE_ENDIAN) 160# if defined (_MIPSEB) || defined (__sparc) || defined (_AIX) || \ 161 defined (__hpux) || defined (macintosh) || defined (_MAC) 162# define _STLP_BIG_ENDIAN 1 163# elif defined (__i386) || defined (_M_IX86) || defined (_M_ARM) || \ 164 defined (__amd64__) || defined (_M_AMD64) || defined (__x86_64__) || \ 165 defined (__alpha__) || defined (_MIPSEL) 166# define _STLP_LITTLE_ENDIAN 1 167# elif defined (__ia64__) 168 /* itanium allows both settings (for instance via gcc -mbig-endian) - hence a seperate check is required */ 169# if defined (__BIG_ENDIAN__) 170# define _STLP_BIG_ENDIAN 1 171# else 172# define _STLP_LITTLE_ENDIAN 1 173# endif 174# else 175# error "can't determine endianess" 176# endif 177#endif /* _STLP_BIG_ENDIAN */ 178 179/* ========================================================== 180 * final workaround tuning based on given flags 181 * ========================================================== */ 182 183#ifndef _STLP_UINT32_T 184# define _STLP_UINT32_T unsigned long 185#endif 186#ifndef _STLP_ABORT 187# define _STLP_ABORT() abort() 188#endif 189 190#if !defined (_STLP_HAS_NO_NAMESPACES) 191# if defined _STLP_NO_NAMESPACES 192# undef _STLP_USE_NAMESPACES 193# else 194/* assume it as the default, turn it off later if NO_NAMESPACES selected */ 195# undef _STLP_USE_NAMESPACES 196# define _STLP_USE_NAMESPACES 1 197# endif 198#endif 199 200#if defined (_STLP_NO_IOSTREAMS) 201# define _STLP_USE_NO_IOSTREAMS 202#endif 203 204/* Operating system recognition (basic) */ 205#if (defined(__unix) || defined(__linux__) || defined(__QNX__) || defined(_AIX) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__Lynx__) || defined(__hpux) || defined(__sgi)) && \ 206 !defined (_STLP_UNIX) 207# define _STLP_UNIX 1 208#endif /* __unix */ 209 210#if !defined (_STLP_NO_LONG_DOUBLE) 211# define _STLP_LONGEST_FLOAT_TYPE long double 212#else 213# define _STLP_LONGEST_FLOAT_TYPE double 214#endif 215 216/* Native headers access macros */ 217#if !defined (_STLP_HAS_INCLUDE_NEXT) 218# include <stl/config/_native_headers.h> 219#endif 220 221/* shared library tune-up */ 222 223#if defined (__BUILDING_STLPORT) 224/* if we are rebuilding right now, place everything here */ 225# undef _STLP_DESIGNATED_DLL 226# define _STLP_DESIGNATED_DLL 1 227#endif 228 229/* Use own namespace always if possible and not explicitly instructed otherwise */ 230#if defined (_STLP_USE_NAMESPACES) && !defined (_STLP_BROKEN_USING_DIRECTIVE) && \ 231 !defined (_STLP_NO_OWN_NAMESPACE) 232# undef _STLP_USE_OWN_NAMESPACE 233# define _STLP_USE_OWN_NAMESPACE 1 234#else 235# undef _STLP_WHOLE_NATIVE_STD 236#endif 237 238#if !defined (_NOTHREADS) && !defined (_STLP_THREADS_DEFINED) 239 240# if defined (_PTHREADS) 241# define _STLP_PTHREADS 242# define _STLP_THREADS 243# endif 244# if defined (_UITHREADS) 245# define _STLP_UITHREADS 246# define _STLP_THREADS 247# endif 248 249# if defined (_STLP_WIN32) && !defined (_STLP_PTHREADS) 250# define _STLP_WIN32THREADS 1 251# elif ((defined (__sun) && !defined (__linux__)) || defined (_UITHREADS) ) && \ 252 !defined(_STLP_PTHREADS) 253# define _STLP_UITHREADS 254# else 255# define _STLP_PTHREADS 256# endif /* __sgi */ 257# define _STLP_THREADS_DEFINED 258#endif 259 260#if (defined (_REENTRANT) || defined (_THREAD_SAFE)) && !defined (_STLP_THREADS) 261# define _STLP_THREADS 262#endif 263 264#ifndef _STLP_STATIC_MUTEX 265# define _STLP_STATIC_MUTEX _STLP_mutex_base 266#endif 267 268#if (defined (_MFC_VER) || defined (_AFXDLL)) && !defined (_STLP_USE_MFC) 269# define _STLP_USE_MFC 1 270#endif 271 272#if defined (_STLP_THREADS) 273# define _STLP_VOLATILE volatile 274#else 275# define _STLP_VOLATILE 276#endif 277 278#if !defined (_STLP_USE_NEW_C_HEADERS) && !defined (_STLP_HAS_NO_NEW_C_HEADERS) 279# define _STLP_USE_NEW_C_HEADERS 280#endif 281/* disable new-style headers if requested */ 282#if defined (_STLP_NO_NEW_C_HEADERS) 283# undef _STLP_USE_NEW_C_HEADERS 284#endif 285 286#if defined (_STLP_BASE_TYPEDEF_BUG) 287# undef _STLP_BASE_TYPEDEF_OUTSIDE_BUG 288# define _STLP_BASE_TYPEDEF_OUTSIDE_BUG 1 289#endif 290 291#if defined (_STLP_NESTED_TYPE_PARAM_BUG) 292# define _STLP_GLOBAL_NESTED_RETURN_TYPE_PARAM_BUG 293#endif 294 295/* SUNpro 4.2 inline string literal bug */ 296#ifdef _STLP_INLINE_STRING_LITERAL_BUG 297# define _STLP_FIX_LITERAL_BUG(__x) __x = __x; 298#else 299# define _STLP_FIX_LITERAL_BUG(__x) 300#endif 301 302#if defined (_STLP_NON_TYPE_TMPL_PARAM_BUG) 303# undef _STLP_NO_DEFAULT_NON_TYPE_PARAM 304# define _STLP_NO_DEFAULT_NON_TYPE_PARAM 1 305#endif 306 307#if !defined (_STLP_STATIC_ASSERT) 308/* Some compiler support 0 size array so we use negative size array to generate 309 * a compilation time error. 310 */ 311# define _STLP_STATIC_ASSERT(expr) typedef char __static_assert[expr ? 1 : -1]; 312#endif 313 314/* apple mpw exception handling bug */ 315#ifndef _STLP_MPWFIX_TRY 316# define _STLP_MPWFIX_TRY 317#endif 318#ifndef _STLP_MPWFIX_CATCH 319# define _STLP_MPWFIX_CATCH 320#endif 321#ifndef _STLP_MPWFIX_CATCH_ACTION 322# define _STLP_MPWFIX_CATCH_ACTION(action) 323#endif 324 325#if !defined (_STLP_WEAK) 326# define _STLP_WEAK 327#endif 328 329/* default parameters as template types derived from arguments ( not always supported ) */ 330#if defined (_STLP_LIMITED_DEFAULT_TEMPLATES) 331# define _STLP_DFL_TMPL_PARAM( classname, defval ) class classname 332#else 333# if !defined (_STLP_DEFAULT_TYPE_PARAM) 334# define _STLP_DEFAULT_TYPE_PARAM 1 335# endif 336# define _STLP_DFL_TMPL_PARAM( classname, defval ) class classname = defval 337#endif 338 339#if defined (_STLP_LIMITED_DEFAULT_TEMPLATES) 340# define _STLP_DEFAULT_PAIR_ALLOCATOR_SELECT(_Key, _Tp ) class _Alloc 341#else 342# define _STLP_DEFAULT_PAIR_ALLOCATOR_SELECT(_Key, _Tp ) \ 343 class _Alloc = allocator< pair < _Key, _Tp > > 344#endif 345 346/* default parameters as complete types */ 347#if defined (_STLP_DEFAULT_TYPE_PARAM) 348# define _STLP_DFL_TYPE_PARAM( classname, defval ) class classname = defval 349# define _STLP_DFL_NON_TYPE_PARAM(type,name,val) type name = val 350#else 351# define _STLP_DFL_TYPE_PARAM( classname, defval ) class classname 352# define _STLP_DFL_NON_TYPE_PARAM(type,name,val) type name 353#endif 354 355/* SGI compatibility */ 356 357#ifdef _STLP_NO_WCHAR_T 358# ifndef _STLP_NO_NATIVE_WIDE_STREAMS 359# define _STLP_NO_NATIVE_WIDE_STREAMS 1 360# endif 361#else 362# define _STLP_HAS_WCHAR_T 1 363#endif 364 365#if !defined (_STLP_NO_AT_MEMBER_FUNCTION) 366# define _STLP_CAN_THROW_RANGE_ERRORS 1 367#endif 368 369/* debug mode tool */ 370#if defined (_STLP_DEBUG) 371# define _STLP_NON_DBG_NAME(X) _NonDbg_##X 372#endif 373 374/* pointer specialization tool */ 375#if defined (_STLP_USE_PTR_SPECIALIZATIONS) 376# define _STLP_PTR_IMPL_NAME(X) _Impl_##X 377#endif 378 379#if defined (_STLP_USE_MSVC6_MEM_T_BUG_WORKAROUND) || \ 380 defined (_STLP_SIGNAL_RUNTIME_COMPATIBILITY) || defined (_STLP_CHECK_RUNTIME_COMPATIBILITY) 381# define _STLP_NO_MEM_T_NAME(X) _NoMemT_##X 382#endif 383 384/* this always mean the C library is in global namespace */ 385#if defined (_STLP_HAS_NO_NEW_C_HEADERS) && !defined (_STLP_VENDOR_GLOBAL_CSTD) 386# define _STLP_VENDOR_GLOBAL_CSTD 1 387#endif 388 389/* Depending of whether compiler supports namespaces, 390 * tune the parameters for vendor-supplied libraries. 391 * This section is guarded by _STLP_HAS_NO_NAMESPACES, not by _STLP_USE_NAMESPACES, 392 * since it depends only on the native features, not on user's preference whether 393 * to use namespace for STLport or not. 394 */ 395#if !defined (_STLP_HAS_NO_NAMESPACES) 396/* Import some vendor's headers into corresponding STLport ones if they might be needed 397 * (if we wrap native iostreams and use namepace other than std::) */ 398# if defined (_STLP_WHOLE_NATIVE_STD) 399# define _STLP_IMPORT_VENDOR_STD 1 400# endif 401 402/* if using stlport:: namespace or if C library stuff is not in vendor's std::, 403 * try importing 'em. 404 * MSVC has ambiguity problem when we try to import C-style std:: stuff back into global namespace */ 405# if defined (_STLP_USE_NAMESPACES) && (defined(_STLP_USE_OWN_NAMESPACE) || defined (_STLP_VENDOR_GLOBAL_CSTD)) 406# define _STLP_IMPORT_VENDOR_CSTD 1 407# endif 408 409# if defined (_STLP_NO_USING_FOR_GLOBAL_FUNCTIONS) && !defined (_STLP_DO_IMPORT_CSTD_FUNCTIONS) 410# define _STLP_NO_CSTD_FUNCTION_IMPORTS 411# endif 412 413# define _STLP_USING_NAMESPACE(x) using namespace x ; 414 415namespace std { } 416namespace __std_alias = std; 417 418/* assume std:: namespace for C++ std library if not being told otherwise */ 419# if defined (_STLP_VENDOR_GLOBAL_STD) 420# define _STLP_VENDOR_STD 421# else 422# define _STLP_VENDOR_STD std 423# endif 424 425/* tune things that come from C library */ 426# if defined (_STLP_VENDOR_GLOBAL_CSTD) || !defined(_STLP_USE_NEW_C_HEADERS) 427/* in old-style headers, C functions go to global scope. */ 428# define _STLP_VENDOR_CSTD 429# define _STLP_USING_VENDOR_CSTD 430# else 431# define _STLP_VENDOR_CSTD _STLP_VENDOR_STD 432# define _STLP_USING_VENDOR_CSTD _STLP_USING_NAMESPACE(_STLP_VENDOR_CSTD) 433# endif /* _STLP_VENDOR_CSTD */ 434/* exception, typeinfo, new - always come from the vendor */ 435# if !defined (_STLP_VENDOR_EXCEPT_STD) 436# if defined (_STLP_VENDOR_GLOBAL_EXCEPT_STD) 437# define _STLP_VENDOR_EXCEPT_STD 438# else 439# define _STLP_VENDOR_EXCEPT_STD _STLP_VENDOR_STD 440# endif 441# endif 442# define _STLP_OLD_IO_NAMESPACE 443# if !defined (_STLP_VENDOR_MB_NAMESPACE) 444# define _STLP_VENDOR_MB_NAMESPACE _STLP_VENDOR_CSTD 445# endif 446#else 447/* compiler has no namespace support */ 448# define _STLP_VENDOR_STD 449# define _STLP_VENDOR_CSTD 450# define _STLP_USING_NAMESPACE(x) 451# define _STLP_USING_VENDOR_CSTD 452# define _STLP_VENDOR_EXCEPT_STD 453#endif 454 455#if defined (_STLP_USE_NAMESPACES) 456 457# if defined (_STLP_USE_OWN_NAMESPACE) 458# if !defined (_STLP_STD_NAME) 459# if !defined (_STLP_DEBUG) 460# if !defined (_STLP_USING_CROSS_NATIVE_RUNTIME_LIB) 461# ifndef _STLP_THREADS 462# define _STLP_STD_NAME stlpmtx_std 463# else 464# define _STLP_STD_NAME stlp_std 465# endif 466# else 467# ifndef _STLP_THREADS 468# define _STLP_STD_NAME stlpxmtx_std 469# else 470# define _STLP_STD_NAME stlpx_std 471# endif 472# endif 473# else 474/* 475 * The STLport debug mode is binary incompatible with the other modes, 476 * lets make it clear on the STLport namespace to generate link errors rather 477 * than runtime ones. 478 */ 479# if !defined (_STLP_USING_CROSS_NATIVE_RUNTIME_LIB) 480# ifndef _STLP_THREADS 481# define _STLP_STD_NAME stlpdmtx_std 482# else 483# define _STLP_STD_NAME stlpd_std 484# endif 485# else 486# ifndef _STLP_THREADS 487# define _STLP_STD_NAME stlpdxmtx_std 488# else 489# define _STLP_STD_NAME stlpdx_std 490# endif 491# endif 492# endif 493# endif 494namespace _STLP_STD_NAME { } 495# else 496# define _STLP_STD_NAME std 497# endif /* _STLP_USE_OWN_NAMESPACE */ 498 499# define _STLP_BEGIN_NAMESPACE namespace _STLP_STD_NAME { 500# define _STLP_BEGIN_TR1_NAMESPACE namespace tr1 { 501# define _STLP_END_NAMESPACE } 502 503/* decide whether or not we use separate namespace for rel ops */ 504# if defined (_STLP_NO_RELOPS_NAMESPACE) 505# define _STLP_BEGIN_RELOPS_NAMESPACE _STLP_BEGIN_NAMESPACE namespace rel_ops {} 506# define _STLP_END_RELOPS_NAMESPACE } 507# else 508/* Use std::rel_ops namespace */ 509# define _STLP_BEGIN_RELOPS_NAMESPACE _STLP_BEGIN_NAMESPACE namespace rel_ops { 510# define _STLP_END_RELOPS_NAMESPACE } } 511# define _STLP_USE_SEPARATE_RELOPS_NAMESPACE 512# endif /* Use std::rel_ops namespace */ 513 514# define _STLP_STD ::_STLP_STD_NAME 515# if !defined (_STLP_TR1) 516# define _STLP_TR1 _STLP_STD::tr1:: 517# endif 518 519# if !defined (_STLP_DONT_USE_PRIV_NAMESPACE) 520# define _STLP_PRIV_NAME priv 521# define _STLP_PRIV _STLP_STD::_STLP_PRIV_NAME:: 522# define _STLP_MOVE_TO_PRIV_NAMESPACE namespace _STLP_PRIV_NAME { 523# define _STLP_MOVE_TO_STD_NAMESPACE } 524# else 525# if !defined (_STLP_PRIV) 526# define _STLP_PRIV _STLP_STD:: 527# endif 528# define _STLP_MOVE_TO_PRIV_NAMESPACE 529# define _STLP_MOVE_TO_STD_NAMESPACE 530# endif 531 532/* Official STLport namespace when std is not redefined. 533 * Here we don't use a macro because we do not need it and because 534 * stlport is used as file name by boost and folder name under beos: 535 */ 536namespace stlport = _STLP_STD_NAME; 537 538/* Backward compatibility: 539 */ 540namespace _STL = _STLP_STD_NAME; 541#undef __STLPORT_NAMESPACE 542#define __STLPORT_NAMESPACE _STLP_STD_NAME 543 544#else /* _STLP_USE_NAMESPACES */ 545/* STLport is being put into global namespace */ 546# define _STLP_STD 547# define _STLP_PRIV 548# define _STLP_TR1 549# define _STLP_BEGIN_NAMESPACE 550# define _STLP_BEGIN_TR1_NAMESPACE 551# define _STLP_END_NAMESPACE 552# define _STLP_MOVE_TO_PRIV_NAMESPACE 553# define _STLP_MOVE_TO_STD_NAMESPACE 554 555/* boris : it was found out that _STLP_USE_SEPARATE_RELOPS_NAMESPACE 556 causes less problems than having relational operator templates in global namespace 557 Please define _STLP_NO_RELOPS_NAMESPACE in config/user_config.h if your code rely on them. */ 558# if !defined (_STLP_NO_RELOPS_NAMESPACE) 559# define _STLP_USE_SEPARATE_RELOPS_NAMESPACE 560# endif 561# define _STLP_BEGIN_RELOPS_NAMESPACE 562# define _STLP_END_RELOPS_NAMESPACE 563# undef _STLP_USE_OWN_NAMESPACE 564#endif /* _STLP_USE_NAMESPACES */ 565 566#define STLPORT_CSTD _STLP_VENDOR_CSTD 567#define STLPORT _STLP_STD_NAME 568 569#if defined(_STLP_BOGUS_TEMPLATE_TYPE_MATCHING_BUG) 570# define _STLP_SIMPLE_TYPE(T) _stl_trivial_proxy<T> 571#else 572# define _STLP_SIMPLE_TYPE(T) T 573#endif 574 575#ifndef _STLP_RAND48 576# define _STLP_NO_DRAND48 577#endif 578 579/* advanced keywords usage */ 580#define __C_CAST(__x, __y) ((__x)(__y)) 581#ifndef _STLP_NO_NEW_STYLE_CASTS 582# define __CONST_CAST(__x,__y) const_cast<__x>(__y) 583# define __STATIC_CAST(__x,__y) static_cast<__x>(__y) 584# define __REINTERPRET_CAST(__x,__y) reinterpret_cast<__x>(__y) 585#else 586# define __STATIC_CAST(__x,__y) __C_CAST(__x, __y) 587# define __CONST_CAST(__x,__y) __C_CAST(__x, __y) 588# define __REINTERPRET_CAST(__x,__y) __C_CAST(__x, __y) 589#endif 590 591#if defined (_STLP_NEED_TYPENAME) && ! defined (typename) 592# define typename 593#endif 594 595#if defined (_STLP_NEED_TYPENAME) || defined (_STLP_NO_TYPENAME_ON_RETURN_TYPE ) 596# define _STLP_TYPENAME_ON_RETURN_TYPE 597#else 598# define _STLP_TYPENAME_ON_RETURN_TYPE typename 599#endif 600 601#ifdef _STLP_NO_TYPENAME_IN_TEMPLATE_HEADER 602# define _STLP_HEADER_TYPENAME 603#else 604# define _STLP_HEADER_TYPENAME typename 605#endif 606 607#ifdef _STLP_NO_TYPENAME_BEFORE_NAMESPACE 608# define _STLP_TYPENAME 609#else 610# define _STLP_TYPENAME typename 611#endif 612 613#ifndef _STLP_NO_MEMBER_TEMPLATE_KEYWORD 614# define _STLP_TEMPLATE template 615#else 616# define _STLP_TEMPLATE 617#endif 618 619#if defined (_STLP_USE_CONTAINERS_EXTENSION) 620# define _STLP_KEY_TYPE_FOR_CONT_EXT(type) 621# define _STLP_TEMPLATE_FOR_CONT_EXT template <class _KT> 622#else 623# define _STLP_KEY_TYPE_FOR_CONT_EXT(type) typedef type _KT; 624# define _STLP_TEMPLATE_FOR_CONT_EXT 625#endif 626 627#if defined (_STLP_NEED_EXPLICIT) && !defined (explicit) 628# define explicit 629#endif 630 631#if !defined (_STLP_NEED_MUTABLE) 632# define _STLP_MUTABLE(type, x) x 633#else 634# define _STLP_MUTABLE(type, x) __CONST_CAST(type*, this)->x 635# define mutable 636#endif 637 638#if defined (_STLP_NO_SIGNED_BUILTINS) 639/* old HP-UX doesn't understand "signed" keyword */ 640# define signed 641#endif 642 643#if defined (_STLP_LOOP_INLINE_PROBLEMS) 644# define _STLP_INLINE_LOOP 645#else 646# define _STLP_INLINE_LOOP inline 647#endif 648 649#ifndef _STLP_NO_PARTIAL_SPECIALIZATION_SYNTAX 650# define _STLP_TEMPLATE_NULL template<> 651#else 652# define _STLP_TEMPLATE_NULL 653#endif 654 655#ifdef _STLP_FUNCTION_TMPL_PARTIAL_ORDER 656# define _STLP_OPERATOR_TEMPLATE 657#else 658# define _STLP_OPERATOR_TEMPLATE _STLP_TEMPLATE_NULL 659#endif 660 661#ifndef _STLP_CLASS_PARTIAL_SPECIALIZATION 662/* unless we have other compiler problem, try simulating partial spec here */ 663# if !defined (_STLP_DONT_SIMULATE_PARTIAL_SPEC_FOR_TYPE_TRAITS) 664# define _STLP_SIMULATE_PARTIAL_SPEC_FOR_TYPE_TRAITS 665# endif 666/* For your own iterators, please use inheritance from iterator<> instead of these obsolete queries. */ 667# if (defined (_STLP_NESTED_TYPE_PARAM_BUG) || !defined (_STLP_SIMULATE_PARTIAL_SPEC_FOR_TYPE_TRAITS)) 668# if ! defined ( _STLP_USE_OLD_HP_ITERATOR_QUERIES ) 669# define _STLP_USE_OLD_HP_ITERATOR_QUERIES 670# endif 671# elif defined ( _STLP_NO_ANACHRONISMS ) 672# undef _STLP_USE_OLD_HP_ITERATOR_QUERIES 673# endif 674#endif 675 676#ifndef _STLP_NO_EXPLICIT_FUNCTION_TMPL_ARGS 677# define _STLP_NULL_TMPL_ARGS <> 678# else 679# define _STLP_NULL_TMPL_ARGS 680#endif 681 682#if !defined (_STLP_ALLOCATOR_TYPE_DFL) 683# if defined (_STLP_DONT_SUP_DFLT_PARAM) 684# define _STLP_NEEDS_EXTRA_TEMPLATE_CONSTRUCTORS 685# endif 686# if defined (_STLP_NEEDS_EXTRA_TEMPLATE_CONSTRUCTORS) 687# define _STLP_ALLOCATOR_TYPE_DFL 688# else 689# define _STLP_ALLOCATOR_TYPE_DFL = allocator_type() 690# endif 691#endif 692 693/* When the compiler do not correctly initialized the basic types value in default parameters we prefer 694 * to avoid them to be able to correct this bug. 695 */ 696#if defined (_STLP_DEF_CONST_DEF_PARAM_BUG) 697# define _STLP_DONT_SUP_DFLT_PARAM 1 698#endif 699 700#if defined (__SGI_STL_NO_ARROW_OPERATOR) && ! defined (_STLP_NO_ARROW_OPERATOR) 701# define _STLP_NO_ARROW_OPERATOR 702#endif 703 704#if !defined (_STLP_CLASS_PARTIAL_SPECIALIZATION) 705# if !(defined (_STLP_NO_ARROW_OPERATOR)) && \ 706 !defined (_STLP_NO_MSVC50_COMPATIBILITY) && !defined (_STLP_MSVC50_COMPATIBILITY) 707/* this one is needed for proper reverse_iterator<> operator ->() handling */ 708# define _STLP_MSVC50_COMPATIBILITY 1 709# endif 710#endif 711 712#if defined ( _STLP_CLASS_PARTIAL_SPECIALIZATION ) 713# if (defined(__IBMCPP__) && (500 <= __IBMCPP__) && (__IBMCPP__ < 600) ) 714# define _STLP_DECLARE_REVERSE_ITERATORS(__reverse_iterator) \ 715 typedef typename _STLP_STD :: reverse_iterator<const_iterator> const_reverse_iterator; \ 716 typedef typename _STLP_STD :: reverse_iterator<iterator> reverse_iterator 717# elif (defined (__sgi) && ! defined (__GNUC__)) || defined (__SUNPRO_CC) || defined (__xlC__) 718# define _STLP_DECLARE_REVERSE_ITERATORS(__reverse_iterator) \ 719 typedef _STLP_STD:: _STLP_TEMPLATE reverse_iterator<const_iterator> const_reverse_iterator; \ 720 typedef _STLP_STD:: _STLP_TEMPLATE reverse_iterator<iterator> reverse_iterator 721# else 722# define _STLP_DECLARE_REVERSE_ITERATORS(__reverse_iterator) \ 723 typedef _STLP_STD::reverse_iterator<const_iterator> const_reverse_iterator; \ 724 typedef _STLP_STD::reverse_iterator<iterator> reverse_iterator 725# endif 726#else /* _STLP_CLASS_PARTIAL_SPECIALIZATION */ 727# if defined (_STLP_MSVC50_COMPATIBILITY) 728# define _STLP_DECLARE_REVERSE_ITERATORS(__reverse_iterator) \ 729 typedef _STLP_STD::__reverse_iterator<const_iterator, value_type, const_reference, \ 730 const_pointer, difference_type> const_reverse_iterator; \ 731 typedef _STLP_STD::__reverse_iterator<iterator, value_type, reference, pointer, difference_type> \ 732 reverse_iterator 733# else 734# define _STLP_DECLARE_REVERSE_ITERATORS(__reverse_iterator) \ 735 typedef _STLP_STD::__reverse_iterator<const_iterator, value_type, const_reference, \ 736 difference_type> const_reverse_iterator; \ 737 typedef _STLP_STD::__reverse_iterator<iterator, value_type, \ 738 reference, difference_type> \ 739 reverse_iterator 740# endif 741#endif /* _STLP_CLASS_PARTIAL_SPECIALIZATION */ 742 743#define _STLP_DECLARE_BIDIRECTIONAL_REVERSE_ITERATORS \ 744 _STLP_DECLARE_REVERSE_ITERATORS(reverse_bidirectional_iterator) 745#define _STLP_DECLARE_RANDOM_ACCESS_REVERSE_ITERATORS \ 746 _STLP_DECLARE_REVERSE_ITERATORS(reverse_iterator) 747 748#define __IMPORT_CONTAINER_TYPEDEFS(_Super) \ 749 typedef typename _Super::value_type value_type; \ 750 typedef typename _Super::size_type size_type; \ 751 typedef typename _Super::difference_type difference_type; \ 752 typedef typename _Super::reference reference; \ 753 typedef typename _Super::const_reference const_reference; \ 754 typedef typename _Super::pointer pointer; \ 755 typedef typename _Super::const_pointer const_pointer; \ 756 typedef typename _Super::allocator_type allocator_type; 757 758 759#define __IMPORT_ITERATORS(_Super) \ 760 typedef typename _Super::iterator iterator; \ 761 typedef typename _Super::const_iterator const_iterator; 762 763#define __IMPORT_REVERSE_ITERATORS(_Super) \ 764 typedef typename _Super::const_reverse_iterator const_reverse_iterator; \ 765 typedef typename _Super::reverse_iterator reverse_iterator; 766 767#define __IMPORT_SUPER_COPY_ASSIGNMENT(__derived_name, _Self, _SUPER) \ 768 __derived_name(const _Super& __x) : _SUPER(__x) {} \ 769 _Self& operator=(const _Super& __x) { \ 770 *(_Super*)this = __x; \ 771 return *this; \ 772 } \ 773 __derived_name(const _Self& __x) : _SUPER(__x) {} \ 774 _Self& operator=(const _Self& __x) { \ 775 *(_Super*)this = __x; \ 776 return *this; \ 777 } 778 779#define __IMPORT_WITH_ITERATORS(_Super) \ 780 __IMPORT_CONTAINER_TYPEDEFS(_Super) __IMPORT_ITERATORS(_Super) 781 782#define __IMPORT_WITH_REVERSE_ITERATORS(_Super) \ 783 __IMPORT_WITH_ITERATORS(_Super) __IMPORT_REVERSE_ITERATORS(_Super) 784 785#if defined (_STLP_TRIVIAL_CONSTRUCTOR_BUG) 786# define __TRIVIAL_CONSTRUCTOR(__type) __type() {} 787#else 788# define __TRIVIAL_CONSTRUCTOR(__type) 789#endif 790 791#if defined (_STLP_TRIVIAL_DESTRUCTOR_BUG) 792# define __TRIVIAL_DESTRUCTOR(__type) ~__type() {} 793#else 794# define __TRIVIAL_DESTRUCTOR(__type) 795#endif 796 797#define __TRIVIAL_STUFF(__type) \ 798 __TRIVIAL_CONSTRUCTOR(__type) __TRIVIAL_DESTRUCTOR(__type) 799 800#if defined (_STLP_STATIC_CONST_INIT_BUG) 801# define _STLP_STATIC_CONSTANT(__type, __assignment) enum { __assignment } 802#else 803# define _STLP_STATIC_CONSTANT(__type, __assignment) static const __type __assignment 804#endif 805 806#if defined (_STLP_HAS_NO_EXCEPTIONS) 807# define _STLP_NO_EXCEPTIONS 808#endif 809 810#if !defined (_STLP_DONT_USE_EXCEPTIONS) && !defined (_STLP_NO_EXCEPTIONS) && !defined (_STLP_USE_EXCEPTIONS) 811# define _STLP_USE_EXCEPTIONS 812#endif 813 814#if defined (_STLP_USE_EXCEPTIONS) 815# define _STLP_TRY try 816# define _STLP_CATCH_ALL catch(...) 817# ifndef _STLP_THROW 818# define _STLP_THROW(x) throw x 819# endif 820# define _STLP_RETHROW throw 821 822# define _STLP_UNWIND(action) catch(...) { action; throw; } 823 824# ifdef _STLP_THROW_RETURN_BUG 825# define _STLP_RET_AFTER_THROW(data) return data; 826# else 827# define _STLP_RET_AFTER_THROW(data) 828# endif 829 830# if !defined (_STLP_THROWS) 831# define _STLP_THROWS(x) throw(x) 832# endif 833# if !defined (_STLP_NOTHROW) 834# define _STLP_NOTHROW throw() 835# endif 836#else 837# define _STLP_TRY 838# define _STLP_CATCH_ALL if (false) 839# ifndef _STLP_THROW 840# define _STLP_THROW(x) 841# endif 842# define _STLP_RETHROW {} 843# define _STLP_UNWIND(action) 844# define _STLP_THROWS(x) 845# define _STLP_NOTHROW 846# define _STLP_RET_AFTER_THROW(data) 847#endif 848 849/* 850 * Here we check _STLP_NO_EXCEPTIONS which means that the compiler has no 851 * exception support but not the _STLP_USE_EXCEPTIONS which simply means 852 * that the user do not want to use them. 853 */ 854#if !defined (_STLP_NO_EXCEPTIONS) && !defined (_STLP_NO_EXCEPTION_SPEC) 855# define _STLP_THROWS_INHERENTLY(x) throw x 856# define _STLP_NOTHROW_INHERENTLY throw() 857#else 858# define _STLP_THROWS_INHERENTLY(x) 859# define _STLP_NOTHROW_INHERENTLY 860#endif 861 862/* STLport function not returning are functions that throw so we translate 863 * the noreturn functions in throwing functions taking also into account 864 * exception support activation. 865 */ 866#if defined (_STLP_NORETURN_FUNCTION) && !defined (_STLP_NO_EXCEPTIONS) && \ 867 !defined (_STLP_FUNCTION_THROWS) 868# define _STLP_FUNCTION_THROWS _STLP_NORETURN_FUNCTION 869#else 870# define _STLP_FUNCTION_THROWS 871#endif 872 873#if defined(_STLP_NO_BOOL) 874# if (defined (__IBMCPP__) && (__IBMCPP__ < 400)) && ! defined (_AIX) 875# include <isynonym.hpp> 876# if defined (__OS400__) 877typedef int bool; 878# elif !( defined (__xlC__) || defined (_AIX)) 879typedef Boolean bool; 880# endif 881# else 882# if defined(_STLP_YVALS_H) 883# include <yvals.h> 884# else 885# if defined (_STLP_DONT_USE_BOOL_TYPEDEF) 886# define bool int 887# else 888typedef int bool; 889# endif 890# define true 1 891# define false 0 892# endif 893# endif /* __IBMCPP__ */ 894#else 895# define _STLP_BOOL_KEYWORD 1 896#endif /* _STLP_NO_BOOL */ 897 898/* uninitialized value filler */ 899#ifndef _STLP_SHRED_BYTE 900/* This value is designed to cause problems if an error occurs */ 901# define _STLP_SHRED_BYTE 0xA3 902#endif /* _STLP_SHRED_BYTE */ 903 904/* shared library tune-up */ 905#ifndef _STLP_IMPORT_DECLSPEC 906# define _STLP_IMPORT_DECLSPEC 907#endif 908 909/* a keyword used to instantiate export template */ 910#ifndef _STLP_EXPORT_TEMPLATE_KEYWORD 911# define _STLP_EXPORT_TEMPLATE_KEYWORD 912#endif 913#ifndef _STLP_IMPORT_TEMPLATE_KEYWORD 914# define _STLP_IMPORT_TEMPLATE_KEYWORD 915#endif 916 917#if !defined (_STLP_NO_CONST_IN_PAIR) 918# define _STLP_CONST const 919#else 920# define _STLP_CONST 921#endif 922 923#ifdef _STLP_USE_NO_IOSTREAMS 924/* 925 * If we do not use iostreams we do not use the export/import 926 * techniques to avoid build of the STLport library. 927 */ 928# undef _STLP_USE_DECLSPEC 929/* We also undef USE_DYNAMIC_LIB macro as this macro add some code 930 * to use the dynamic (shared) STLport library for some platform/compiler 931 * configuration leading to problem when not linking to the STLport lib. 932 */ 933# undef _STLP_USE_DYNAMIC_LIB 934#endif 935 936#if defined (_STLP_DLLEXPORT_NEEDS_PREDECLARATION) && defined (_STLP_USE_DECLSPEC) 937# if ! defined (_STLP_USE_TEMPLATE_EXPORT) 938/* this setting turns on "extern template" extension use */ 939# define _STLP_USE_TEMPLATE_EXPORT 940# endif 941# if defined (_STLP_DESIGNATED_DLL) && ! defined (_STLP_NO_FORCE_INSTANTIATE) 942# define _STLP_NO_FORCE_INSTANTIATE 943# endif 944#endif 945 946#if defined (_STLP_DESIGNATED_DLL) /* This is a lib which will contain STLport exports */ 947# define _STLP_EXPORT _STLP_EXPORT_TEMPLATE_KEYWORD 948#else 949# define _STLP_EXPORT _STLP_IMPORT_TEMPLATE_KEYWORD 950#endif 951 952#ifndef _STLP_EXPORT_TEMPLATE 953# define _STLP_EXPORT_TEMPLATE _STLP_EXPORT template 954#endif 955 956#if defined (_STLP_USE_DECLSPEC) /* using export/import technique */ 957 958# ifndef _STLP_EXPORT_DECLSPEC 959# define _STLP_EXPORT_DECLSPEC 960# endif 961# ifndef _STLP_IMPORT_DECLSPEC 962# define _STLP_IMPORT_DECLSPEC 963# endif 964# ifndef _STLP_CLASS_EXPORT_DECLSPEC 965# define _STLP_CLASS_EXPORT_DECLSPEC 966# endif 967# ifndef _STLP_CLASS_IMPORT_DECLSPEC 968# define _STLP_CLASS_IMPORT_DECLSPEC 969# endif 970# if defined (_STLP_DESIGNATED_DLL) /* This is a lib which will contain STLport exports */ 971# define _STLP_DECLSPEC _STLP_EXPORT_DECLSPEC 972# define _STLP_CLASS_DECLSPEC _STLP_CLASS_EXPORT_DECLSPEC 973# else 974# define _STLP_DECLSPEC _STLP_IMPORT_DECLSPEC /* Other modules, importing STLport exports */ 975# define _STLP_CLASS_DECLSPEC _STLP_CLASS_IMPORT_DECLSPEC 976# endif 977 978#else /* Not using DLL export/import specifications */ 979 980# define _STLP_DECLSPEC 981# define _STLP_CLASS_DECLSPEC 982 983#endif 984 985#define _STLP_EXPORT_TEMPLATE_CLASS _STLP_EXPORT template class _STLP_CLASS_DECLSPEC 986 987#if defined (_STLP_NEED_ADDITIONAL_STATIC_DECLSPEC) 988# define _STLP_STATIC_DECLSPEC _STLP_DECLSPEC 989#else 990# define _STLP_STATIC_DECLSPEC 991#endif 992 993#if !defined (_STLP_CALL) 994# define _STLP_CALL 995#endif 996 997#ifndef _STLP_USE_NO_IOSTREAMS 998 999# if defined (__DECCXX) && ! defined (__USE_STD_IOSTREAM) 1000# define __USE_STD_IOSTREAM 1001# endif 1002 1003/* We only need to expose details of streams implementation 1004 if we use non-standard i/o or are building STLport*/ 1005# if defined (__BUILDING_STLPORT) || defined (_STLP_NO_FORCE_INSTANTIATE) || !defined(_STLP_NO_CUSTOM_IO) 1006# define _STLP_EXPOSE_STREAM_IMPLEMENTATION 1 1007# endif 1008 1009/* We only need to expose details of global implementation if we are building STLport 1010 or have not instantiated everything in the lib */ 1011# if defined (__BUILDING_STLPORT) || defined (_STLP_NO_FORCE_INSTANTIATE) 1012# undef _STLP_EXPOSE_GLOBALS_IMPLEMENTATION 1013# define _STLP_EXPOSE_GLOBALS_IMPLEMENTATION 1 1014# endif 1015 1016#else /* _STLP_USE_NO_IOSTREAMS */ 1017/* when we are not using SGI iostreams, we must expose globals, but not streams implementation */ 1018# define _STLP_EXPOSE_GLOBALS_IMPLEMENTATION 1019#endif /* _STLP_USE_NO_IOSTREAMS */ 1020 1021#ifdef _STLP_PARTIAL_SPEC_NEEDS_TEMPLATE_ARGS 1022# define _STLP_PSPEC2(t1,t2) < t1,t2 > 1023# define _STLP_PSPEC3(t1,t2,t3) < t1,t2,t3 > 1024#else 1025# define _STLP_PSPEC2(t1,t2) /* nothing */ 1026# define _STLP_PSPEC3(t1,t2,t3) /* nothing */ 1027#endif 1028 1029/* Activation of the partial template workaround: 1030 */ 1031#if !defined(_STLP_DONT_USE_PARTIAL_SPEC_WRKD) &&\ 1032 (!defined(_STLP_CLASS_PARTIAL_SPECIALIZATION) || !defined(_STLP_FUNCTION_TMPL_PARTIAL_ORDER)) 1033# define _STLP_USE_PARTIAL_SPEC_WORKAROUND 1034#endif 1035 1036#ifdef _STLP_USE_SEPARATE_RELOPS_NAMESPACE 1037# define _STLP_RELOPS_OPERATORS(_TMPL, _TP) \ 1038_TMPL inline bool _STLP_CALL operator!=(const _TP& __x, const _TP& __y) {return !(__x == __y);}\ 1039_TMPL inline bool _STLP_CALL operator>(const _TP& __x, const _TP& __y) {return __y < __x;}\ 1040_TMPL inline bool _STLP_CALL operator<=(const _TP& __x, const _TP& __y) { return !(__y < __x);}\ 1041_TMPL inline bool _STLP_CALL operator>=(const _TP& __x, const _TP& __y) { return !(__x < __y);} 1042#else 1043# define _STLP_RELOPS_OPERATORS(_TMPL, _TP) 1044#endif 1045 1046#if defined ( _STLP_USE_ABBREVS ) 1047# include <stl/_abbrevs.h> 1048#endif 1049 1050/* Some really useful macro */ 1051#define _STLP_ARRAY_SIZE(A) sizeof(A) / sizeof(A[0]) 1052#define _STLP_ARRAY_AND_SIZE(A) A, sizeof(A) / sizeof(A[0]) 1053 1054#if !defined (_STLP_MARK_PARAMETER_AS_UNUSED) 1055# define _STLP_MARK_PARAMETER_AS_UNUSED(X) (void*)X; 1056#endif 1057 1058#if defined (_STLP_CHECK_RUNTIME_COMPATIBILITY) 1059# if defined (_STLP_USE_NO_IOSTREAMS) 1060# undef _STLP_CHECK_RUNTIME_COMPATIBILITY 1061# else 1062/* The extern "C" simply makes the symbol simpler. */ 1063#if defined (__cplusplus) 1064extern "C" 1065#endif 1066void _STLP_DECLSPEC _STLP_CALL _STLP_CHECK_RUNTIME_COMPATIBILITY(); 1067# endif 1068#endif 1069 1070/* some cleanup */ 1071#undef _STLP_DONT_USE_BOOL_TYPEDEF 1072#undef _STLP_YVALS_H 1073#undef _STLP_LOOP_INLINE_PROBLEMS 1074#undef _STLP_NEED_EXPLICIT 1075#undef _STLP_NEED_TYPENAME 1076#undef _STLP_NO_NEW_STYLE_CASTS 1077#undef __AUTO_CONFIGURED 1078 1079#endif /* _STLP_FEATURES_H */ 1080