genericopenlibs/cppstdlib/stl/stlport/stl/config/_msvc.h
changeset 0 e4d67989cc36
child 18 47c74d1534e1
equal deleted inserted replaced
-1:000000000000 0:e4d67989cc36
       
     1 /* STLport configuration file
       
     2  * It is internal STLport header - DO NOT include it directly
       
     3  * Microsoft Visual C++ 6.0, 7.0, 7.1, 8.0, ICL
       
     4  */
       
     5 
       
     6 #if !defined (_STLP_COMPILER)
       
     7 #  define _STLP_COMPILER "Microsoft Visual Studio C++"
       
     8 #endif
       
     9 
       
    10 #if !defined (__ICL) && !defined (_STLP_MSVC)
       
    11 #  define _STLP_MSVC _MSC_VER
       
    12 #endif
       
    13 
       
    14 #if !defined (_STLP_MSVC_LIB)
       
    15 #  define _STLP_MSVC_LIB _MSC_VER
       
    16 #endif
       
    17 
       
    18 #if defined (__BUILDING_STLPORT) && defined (_MANAGED)
       
    19 /* Building a managed version of STLport is not supported because we haven't
       
    20  * found a good reason to support it. However, building a managed translation
       
    21  * unit using STLport _is_ supported.
       
    22  */
       
    23 #  error Sorry but building a managed version of STLport is not supported.
       
    24 #endif
       
    25 
       
    26 #if defined (_STLP_USING_PLATFORM_SDK_COMPILER)
       
    27 /* This is a specific section for compilers coming with platform SDKs. Native
       
    28  * library coming with it is different from the one coming with commercial
       
    29  * MSVC compilers so there is some specific settings.
       
    30  */
       
    31 #  define _STLP_NATIVE_INCLUDE_PATH ../crt
       
    32 #  define _STLP_VENDOR_GLOBAL_CSTD
       
    33 #  define _STLP_VENDOR_TERMINATE_STD
       
    34 #  define _STLP_GLOBAL_NEW_HANDLER
       
    35 #  if (_STLP_MSVC_LIB <= 1400)
       
    36 /* We hope this bug will be fixed in future versions. */
       
    37 #    define _STLP_NEW_DONT_THROW_BAD_ALLOC 1
       
    38 #  endif
       
    39 #endif
       
    40 
       
    41 #define _STLP_CALL __cdecl
       
    42 
       
    43 #ifndef _STLP_LONG_LONG
       
    44 #  define _STLP_LONG_LONG __int64
       
    45 #endif
       
    46 
       
    47 #define _STLP_PRAGMA_ONCE
       
    48 
       
    49 /* These switches depend on compiler flags. We are hoping here that compilers
       
    50  * simulating MSVC behavior use identical macros to report compilation context.
       
    51  * Otherwise those macros will have to be undef in specific compiler configuration
       
    52  * files.
       
    53  */
       
    54 #ifndef _CPPUNWIND
       
    55 #  define _STLP_DONT_USE_EXCEPTIONS 1
       
    56 #endif
       
    57 
       
    58 #ifndef _CPPRTTI
       
    59 #  define _STLP_NO_RTTI 1
       
    60 #endif
       
    61 
       
    62 #if defined (_MT) && !defined (_STLP_NO_THREADS) && !defined (_REENTRANT)
       
    63 #  define _REENTRANT 1
       
    64 #endif
       
    65 
       
    66 #if !defined (_NATIVE_WCHAR_T_DEFINED)
       
    67 #  define _STLP_WCHAR_T_IS_USHORT 1
       
    68 #endif
       
    69 
       
    70 #define _STLP_MINIMUM_IMPORT_STD
       
    71 #define _STLP_NO_VENDOR_STDLIB_L 1
       
    72 
       
    73 #if defined (_STLP_MSVC)
       
    74 
       
    75 #define _STLP_NORETURN_FUNCTION __declspec(noreturn)
       
    76 
       
    77 /* Full compiler version comes from boost library intrinsics.hpp header. */
       
    78 #  if defined (_MSC_FULL_VER) && (_MSC_FULL_VER >= 140050215)
       
    79 #    define _STLP_HAS_TRIVIAL_CONSTRUCTOR(T) __has_trivial_constructor(T)
       
    80 #    define _STLP_HAS_TRIVIAL_COPY(T) __has_trivial_copy(T)
       
    81 #    define _STLP_HAS_TRIVIAL_ASSIGN(T) __has_trivial_assign(T)
       
    82 #    define _STLP_HAS_TRIVIAL_DESTRUCTOR(T) __has_trivial_destructor(T)
       
    83 #    define _STLP_IS_POD(T) __is_pod(T)
       
    84 #    define _STLP_HAS_TYPE_TRAITS_INTRINSICS
       
    85 #  endif
       
    86 
       
    87 #  ifndef _STLP_MSVC50_COMPATIBILITY
       
    88 #    define _STLP_MSVC50_COMPATIBILITY   1
       
    89 #  endif
       
    90 
       
    91 #  define _STLP_DLLEXPORT_NEEDS_PREDECLARATION 1
       
    92 #  define _STLP_HAS_SPECIFIC_PROLOG_EPILOG 1
       
    93 
       
    94 /* # ifndef __BUILDING_STLPORT
       
    95  * #  define _STLP_USE_TEMPLATE_EXPORT 1
       
    96  * # endif
       
    97  */
       
    98 #  if (_STLP_MSVC <= 1401)
       
    99 #    define _STLP_STATIC_CONST_INIT_BUG   1
       
   100 #  endif
       
   101 
       
   102 /** Note: the macro _STLP_NO_UNCAUGHT_EXCEPT_SUPPORT is defined
       
   103 unconditionally and undef'ed here when applicable. */
       
   104 #  if defined(UNDER_CE)
       
   105 /* eVCx:
       
   106 uncaught_exception is declared in the SDKs delivered with eVC4 (eVC3 is
       
   107 unknown) and they all reside in namespace 'std' there. However, they are not
       
   108 part of any lib so linking fails. When using VC8 to crosscompile for CE 5 on
       
   109 an ARMV4I, the uncaught_exception test fails, the function returns the wrong
       
   110 value. */
       
   111 #  else
       
   112 /* VCx:
       
   113 These are present at least since VC6, but the uncaught_exception() of VC6 is
       
   114 broken, it returns the wrong value in the unittests. 7.1 and later seem to
       
   115 work, 7.0 is still unknown (we assume it works until negative report). */
       
   116 #    if (_STLP_MSVC >= 1300)// VC7 and later
       
   117 #      undef _STLP_NO_UNCAUGHT_EXCEPT_SUPPORT
       
   118 #      if !defined (_STLP_DONT_USE_EXCEPTIONS)
       
   119 #        define _STLP_NOTHROW throw()
       
   120 #      endif
       
   121 #    endif
       
   122 #  endif
       
   123 
       
   124 #  if (_STLP_MSVC <= 1300)
       
   125 #    define _STLP_NO_CLASS_PARTIAL_SPECIALIZATION 1
       
   126 #    define _STLP_NO_FUNCTION_TMPL_PARTIAL_ORDER 1
       
   127 /* There is no partial spec, and MSVC breaks on simulating it for iterator_traits queries */
       
   128 #    define _STLP_USE_OLD_HP_ITERATOR_QUERIES
       
   129 #    define _STLP_NO_TYPENAME_IN_TEMPLATE_HEADER
       
   130 #    define _STLP_NO_METHOD_SPECIALIZATION 1
       
   131 #    define _STLP_DEF_CONST_PLCT_NEW_BUG 1
       
   132 #    define _STLP_NO_TYPENAME_ON_RETURN_TYPE 1
       
   133 /* VC++ cannot handle default allocator argument in template constructors */
       
   134 #    define _STLP_NEEDS_EXTRA_TEMPLATE_CONSTRUCTORS
       
   135 #    define _STLP_NO_QUALIFIED_FRIENDS    1
       
   136 #    define _STLP_NO_FRIEND_TEMPLATES
       
   137 /* Fails to properly resolve call to sin() from within sin() */
       
   138 #  endif
       
   139 
       
   140 #  if (_STLP_MSVC < 1300)
       
   141 #    define _STLP_NO_IEC559_SUPPORT 1
       
   142 #  endif
       
   143 
       
   144 #  if (_STLP_MSVC < 1300) /* including MSVC 6.0 */
       
   145 #    define _STLP_NO_MEMBER_TEMPLATE_KEYWORD 1
       
   146 #    define _STLP_DONT_SUPPORT_REBIND_MEMBER_TEMPLATE 1
       
   147 #  endif
       
   148 
       
   149 #  if (_STLP_MSVC >= 1200)
       
   150 #    define _STLP_HAS_NATIVE_FLOAT_ABS 1
       
   151 #  endif
       
   152 
       
   153 // TODO: some eVC4 compilers report _MSC_VER 1201 or 1202, which category do they belong to?
       
   154 #  if (_STLP_MSVC > 1200) && (_STLP_MSVC < 1310)
       
   155 #    define _STLP_NO_MOVE_SEMANTIC
       
   156 #  endif
       
   157 
       
   158 #  if (_STLP_MSVC < 1300)
       
   159 /* TODO: remove this if it is handled and documented elsewhere
       
   160  * dums: VC6 do not handle correctly member templates of class that are explicitely
       
   161  * instanciated to be exported. There is a workaround, seperate the non template methods
       
   162  * from the template ones within 2 different classes and only export the non template one.
       
   163  * It is implemented for basic_string and locale at the writing of this note.
       
   164  * However this problem hos not  been considered as important enough to remove template member
       
   165  * methods for other classes. Moreover Boost (www.boost.org) required it to be granted.
       
   166  * The workaround is activated thanks to the _STLP_USE_MSVC6_MEM_T_BUG_WORKAROUND macro defined
       
   167  * later in this config file.
       
   168  */
       
   169 /*
       
   170 #    if defined (_DLL)
       
   171 #      define _STLP_NO_MEMBER_TEMPLATES 1
       
   172 #    endif
       
   173 */
       
   174 
       
   175 /* Boris : not defining this macro for SP5 causes other problems */
       
   176 /*#    if !defined (_MSC_FULL_VER) || (_MSC_FULL_VER < 12008804 ) */
       
   177 #    define _STLP_NO_USING_FOR_GLOBAL_FUNCTIONS 1
       
   178 /*#    endif */
       
   179 #    define _STLP_DONT_USE_BOOL_TYPEDEF 1
       
   180 #    define _STLP_DONT_RETURN_VOID 1
       
   181 #  endif
       
   182 
       
   183 /*
       
   184  * MSVC6 is known to have many trouble with namespace management but
       
   185  * MSVC .Net 2003 and 2005 also have a bug difficult to reproduce without
       
   186  * STLport:
       
   187  * namespace stlp_std {
       
   188  *   typedef int foo_int;
       
   189  * }
       
   190  * #include <map>
       
   191  * const foo_int bar = 0;
       
   192  *
       
   193  * As you can see foo is available without namespace specification as if
       
   194  * a using namespace stlp_std has been performed. Defining _STLP_USING_NAMESPACE_BUG
       
   195  * restore the expected compilation error.
       
   196  */
       
   197 #  define _STLP_USING_NAMESPACE_BUG 1
       
   198 
       
   199 #  if (_STLP_MSVC < 1300) /* MSVC 6.0 and earlier */
       
   200 #    define _STLP_NO_EXPLICIT_FUNCTION_TMPL_ARGS 1
       
   201 /* defined for DEBUG and NDEBUG too, to allow user mix own debug build with STLP release library */
       
   202 #    define _STLP_USE_ABBREVS
       
   203 #  endif
       
   204 
       
   205 // TODO: what is the earliest version for this? If it is 1200, use _STLP_MSVC>=1200.
       
   206 #  if (_STLP_MSVC > 1100) && (_STLP_MSVC < 1300)
       
   207 typedef char __stl_char;
       
   208 #    define _STLP_DEFAULTCHAR __stl_char
       
   209 #  endif
       
   210 
       
   211 #  if (_STLP_MSVC < 1200) /* before VC++ 6.0 */
       
   212 /* #  define _STLP_NO_MEMBER_TEMPLATES 1 */
       
   213 #    define _STLP_DONT_SIMULATE_PARTIAL_SPEC_FOR_TYPE_TRAITS 1
       
   214 #    define _STLP_DONT_USE_PARTIAL_SPEC_WRKD 1
       
   215 #    define _STLP_QUALIFIED_SPECIALIZATION_BUG 1
       
   216 #    define _STLP_NON_TYPE_TMPL_PARAM_BUG 1
       
   217 #    define _STLP_THROW_RETURN_BUG 1
       
   218 #    define _STLP_NO_MEMBER_TEMPLATE_CLASSES 1
       
   219 #    define _STLP_DEF_CONST_DEF_PARAM_BUG 1
       
   220 #  endif
       
   221 
       
   222 #  if (_STLP_MSVC < 1100 )
       
   223 #    ifndef _STLP_USE_NO_IOSTREAMS
       
   224 #      define _STLP_USE_NO_IOSTREAMS
       
   225 #    endif
       
   226 /* #  define _STLP_NESTED_TYPE_PARAM_BUG 1 */
       
   227 /* Debug mode does not work for 4.2 */
       
   228 #    if defined (_STLP_DEBUG)
       
   229 #      pragma message ("STLport debug mode does not work for VC++ 4.2, turning _STLP_DEBUG off ...")
       
   230 #      undef _STLP_DEBUG
       
   231 #    endif
       
   232 #    define _STLP_NO_BOOL            1
       
   233 #    define _STLP_NEED_TYPENAME      1
       
   234 #    define _STLP_NEED_EXPLICIT      1
       
   235 #    define _STLP_NEED_MUTABLE       1
       
   236 #    define _STLP_NO_PARTIAL_SPECIALIZATION_SYNTAX
       
   237 #    define _STLP_LIMITED_DEFAULT_TEMPLATES 1
       
   238 #    define _STLP_NONTEMPL_BASE_MATCH_BUG 1
       
   239 #    define _STLP_BROKEN_USING_DIRECTIVE  1
       
   240 #    define _STLP_NO_ARROW_OPERATOR 1
       
   241 #    define _STLP_NO_SIGNED_BUILTINS 1
       
   242 #    define _STLP_NO_EXCEPTION_SPEC 1
       
   243 #    define _STLP_HAS_NO_NAMESPACES 1
       
   244 #    define _STLP_NO_AT_MEMBER_FUNCTION 1
       
   245 #    define _STLP_NO_MEMBER_TEMPLATES 1
       
   246 #  endif /* 1100 */
       
   247 
       
   248 #endif /* _STLP_MSVC */
       
   249 
       
   250 /** The desktop variants starting with VC8 have a set of more secure replacements
       
   251 for the error-prone string handling functions of the C standard lib. */
       
   252 #if (_STLP_MSVC_LIB >= 1400) && !defined (_STLP_USING_PLATFORM_SDK_COMPILER) && !defined(UNDER_CE)
       
   253 #  define _STLP_USE_SAFE_STRING_FUNCTIONS 1
       
   254 #endif
       
   255 
       
   256 #if (_STLP_MSVC_LIB <= 1310)
       
   257 #  define _STLP_VENDOR_GLOBAL_CSTD
       
   258 #endif
       
   259 
       
   260 #if (_STLP_MSVC_LIB >= 1300) && !defined(UNDER_CE)
       
   261 /* Starting with MSVC 7.0 and compilers simulating it,
       
   262  * we assume that the new SDK is granted:
       
   263  */
       
   264 #  define _STLP_NEW_PLATFORM_SDK 1
       
   265 #endif
       
   266 
       
   267 #if (_STLP_MSVC_LIB < 1300) /* including MSVC 6.0 */
       
   268 #  define _STLP_GLOBAL_NEW_HANDLER 1
       
   269 #  define _STLP_VENDOR_UNEXPECTED_STD
       
   270 #  define _STLP_NEW_DONT_THROW_BAD_ALLOC 1
       
   271 #endif
       
   272 
       
   273 #if (_STLP_MSVC_LIB < 1100)
       
   274 /* up to 4.2, library is in global namespace */
       
   275 #  define _STLP_VENDOR_GLOBAL_STD
       
   276 #endif
       
   277 
       
   278 #if (_STLP_MSVC_LIB <= 1010)
       
   279 /* "bool" is reserved in MSVC 4.1 while <yvals.h> absent, so : */
       
   280 #  define _STLP_NO_BAD_ALLOC
       
   281 #  define _STLP_HAS_NO_NEW_C_HEADERS 1
       
   282 #  define _STLP_NO_NEW_NEW_HEADER 1
       
   283 #elif (_STLP_MSVC_LIB < 1100)
       
   284 /* VC++ 4.2 and higher */
       
   285 #  define _STLP_YVALS_H 1
       
   286 #  define _STLP_USE_NO_IOSTREAMS 1
       
   287 #endif
       
   288 
       
   289 #define _STLP_EXPORT_DECLSPEC __declspec(dllexport)
       
   290 #define _STLP_IMPORT_DECLSPEC __declspec(dllimport)
       
   291 
       
   292 #if !defined (_STLP_MSVC) || (_STLP_MSVC >= 1100)
       
   293 #  define _STLP_CLASS_EXPORT_DECLSPEC __declspec(dllexport)
       
   294 #  define _STLP_CLASS_IMPORT_DECLSPEC __declspec(dllimport)
       
   295 #endif
       
   296 
       
   297 #if defined (__DLL) || defined (_DLL) || defined (_RTLDLL) || defined (_AFXDLL)
       
   298 #  define _STLP_RUNTIME_DLL
       
   299 #endif
       
   300 #if defined (__BUILDING_STLPORT) && \
       
   301    (defined (_STLP_USE_DYNAMIC_LIB) || \
       
   302     defined (_STLP_RUNTIME_DLL) && !defined (_STLP_USE_STATIC_LIB))
       
   303 #  define _STLP_DLL
       
   304 #endif
       
   305 #include <stl/config/_detect_dll_or_lib.h>
       
   306 #undef _STLP_RUNTIME_DLL
       
   307 #undef _STLP_DLL
       
   308 
       
   309 #if defined (_STLP_USE_DYNAMIC_LIB)
       
   310 #  undef  _STLP_USE_DECLSPEC
       
   311 #  define _STLP_USE_DECLSPEC 1
       
   312 #  if (_STLP_MSVC >= 1200) && (_STLP_MSVC < 1300)
       
   313 #    define _STLP_USE_MSVC6_MEM_T_BUG_WORKAROUND 1
       
   314 #  endif
       
   315 #endif
       
   316 
       
   317 #if !defined (_STLP_IMPORT_TEMPLATE_KEYWORD)
       
   318 #  if !defined (_MSC_EXTENSIONS) || defined(_STLP_MSVC) && _STLP_MSVC >= 1300
       
   319 #    define _STLP_IMPORT_TEMPLATE_KEYWORD
       
   320 #  else
       
   321 #    define _STLP_IMPORT_TEMPLATE_KEYWORD extern
       
   322 #  endif
       
   323 #endif
       
   324 #define _STLP_EXPORT_TEMPLATE_KEYWORD
       
   325 
       
   326 #if defined (_STLP_MSVC) && (_STLP_MSVC < 1200)
       
   327 /*    only static STLport lib now works for VC 5.0 */
       
   328 #  undef  _STLP_USE_STATIC_LIB
       
   329 #  undef  _STLP_USE_DYNAMIC_LIB
       
   330 #  define _STLP_USE_STATIC_LIB
       
   331 /*    disable hook which makes template symbols to be searched for in the library */
       
   332 #  undef _STLP_NO_CUSTOM_IO
       
   333 #endif
       
   334 
       
   335 #include <stl/config/_auto_link.h>
       
   336 
       
   337 #if defined (_STLP_USING_PLATFORM_SDK_COMPILER)
       
   338 /* The Windows 64 bits SDK required for the moment link to bufferoverflowU.lib for
       
   339  * additional buffer overrun checks. Rather than require the STLport build system and
       
   340  * users to explicitely link with it we use the MSVC auto link feature.
       
   341  */
       
   342 #  if !defined (_STLP_DONT_USE_AUTO_LINK) || defined (__BUILDING_STLPORT)
       
   343 #    pragma comment (lib, "bufferoverflowU.lib")
       
   344 #    if defined (_STLP_VERBOSE_AUTO_LINK)
       
   345 #      pragma message ("STLport: Auto linking to bufferoverflowU.lib")
       
   346 #    endif
       
   347 #  endif
       
   348 #endif
       
   349 
       
   350 /* Local Variables:
       
   351  * mode:C++
       
   352  * End:
       
   353  */