_msvc.h 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265
  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. #if !defined (_STLP_COMPILER)
  6. # define _STLP_COMPILER "Microsoft Visual Studio C++"
  7. #endif
  8. #if !defined (__ICL) && !defined (_STLP_MSVC)
  9. # define _STLP_MSVC _MSC_VER
  10. #endif
  11. #if !defined (_STLP_MSVC_LIB)
  12. # define _STLP_MSVC_LIB _MSC_VER
  13. #endif
  14. #if defined (__BUILDING_STLPORT) && defined (_MANAGED)
  15. /* Building a managed version of STLport is not supported because we haven't
  16. * found a good reason to support it. However, building a managed translation
  17. * unit using STLport _is_ supported.
  18. */
  19. # error Sorry but building a managed version of STLport is not supported.
  20. #endif
  21. #if defined (_STLP_USING_PLATFORM_SDK_COMPILER)
  22. /* This is a specific section for compilers coming with platform SDKs. Native
  23. * library coming with it is different from the one coming with commercial
  24. * MSVC compilers so there is some specific settings.
  25. */
  26. # define _STLP_NATIVE_INCLUDE_PATH ../crt
  27. # define _STLP_VENDOR_GLOBAL_CSTD
  28. # define _STLP_VENDOR_TERMINATE_STD
  29. # define _STLP_GLOBAL_NEW_HANDLER
  30. # if (_STLP_MSVC_LIB <= 1400)
  31. /* We hope this bug will be fixed in future versions. */
  32. # define _STLP_NEW_DONT_THROW_BAD_ALLOC 1
  33. # endif
  34. #endif
  35. #define _STLP_CALL __cdecl
  36. #ifndef _STLP_LONG_LONG
  37. # define _STLP_LONG_LONG __int64
  38. #endif
  39. #define _STLP_PRAGMA_ONCE
  40. /* These switches depend on compiler flags. We are hoping here that compilers
  41. * simulating MSVC behavior use identical macros to report compilation context.
  42. * Otherwise those macros will have to be undef in specific compiler configuration
  43. * files.
  44. */
  45. #ifndef _CPPUNWIND
  46. # define _STLP_DONT_USE_EXCEPTIONS 1
  47. #endif
  48. #ifndef _CPPRTTI
  49. # define _STLP_NO_RTTI 1
  50. #endif
  51. #if defined (_MT) && !defined (_STLP_NO_THREADS)
  52. # define _STLP_THREADS 1
  53. #endif
  54. #if defined (_STLP_SGX_CONFIG) || !defined (_NATIVE_WCHAR_T_DEFINED)
  55. # define _STLP_WCHAR_T_IS_USHORT 1
  56. #endif
  57. #define _STLP_NO_VENDOR_STDLIB_L 1
  58. #if defined (_STLP_MSVC)
  59. # if (_STLP_MSVC < 1200)
  60. # error Microsoft Visual C++ compilers before version 6 (SP5) are not supported.
  61. # endif
  62. # define _STLP_NORETURN_FUNCTION __declspec(noreturn)
  63. /* Full compiler version comes from boost library intrinsics.hpp header. */
  64. # if defined (_MSC_FULL_VER) && (_MSC_FULL_VER >= 140050215)
  65. # define _STLP_HAS_TRIVIAL_CONSTRUCTOR(T) __has_trivial_constructor(T)
  66. # define _STLP_HAS_TRIVIAL_COPY(T) __has_trivial_copy(T)
  67. # define _STLP_HAS_TRIVIAL_ASSIGN(T) __has_trivial_assign(T)
  68. # define _STLP_HAS_TRIVIAL_DESTRUCTOR(T) __has_trivial_destructor(T)
  69. # define _STLP_IS_POD(T) __is_pod(T)
  70. # define _STLP_HAS_TYPE_TRAITS_INTRINSICS
  71. # endif
  72. # ifndef _STLP_MSVC50_COMPATIBILITY
  73. # define _STLP_MSVC50_COMPATIBILITY 1
  74. # endif
  75. # define _STLP_DLLEXPORT_NEEDS_PREDECLARATION 1
  76. # define _STLP_HAS_SPECIFIC_PROLOG_EPILOG 1
  77. # define _STLP_NO_STATIC_CONST_DEFINITION 1
  78. /* # ifndef __BUILDING_STLPORT
  79. * # define _STLP_USE_TEMPLATE_EXPORT 1
  80. * # endif
  81. */
  82. /** Note: the macro _STLP_NO_UNCAUGHT_EXCEPT_SUPPORT is defined
  83. unconditionally and undef'ed here when applicable. */
  84. # if defined (UNDER_CE)
  85. /* eVCx:
  86. uncaught_exception is declared in the SDKs delivered with eVC4 (eVC3 is
  87. unknown) and they all reside in namespace 'std' there. However, they are not
  88. part of any lib so linking fails. When using VC8 to crosscompile for CE 5 on
  89. an ARMV4I, the uncaught_exception test fails, the function returns the wrong
  90. value. */
  91. /* All eVCs up to at least VC8/CE5 have a broken new operator that
  92. returns null instead of throwing bad_alloc. */
  93. # define _STLP_NEW_DONT_THROW_BAD_ALLOC 1
  94. # else
  95. /* VCx:
  96. These are present at least since VC6, but the uncaught_exception() of VC6 is
  97. broken, it returns the wrong value in the unittests. 7.1 and later seem to
  98. work, 7.0 is still unknown (we assume it works until negative report). */
  99. # if (_STLP_MSVC >= 1300)// VC7 and later
  100. # undef _STLP_NO_UNCAUGHT_EXCEPT_SUPPORT
  101. # endif
  102. # if (_STLP_MSVC < 1300)
  103. # define _STLP_NOTHROW
  104. # endif
  105. # endif
  106. # if (_STLP_MSVC <= 1300)
  107. # define _STLP_STATIC_CONST_INIT_BUG 1
  108. # define _STLP_NO_CLASS_PARTIAL_SPECIALIZATION 1
  109. # define _STLP_NO_FUNCTION_TMPL_PARTIAL_ORDER 1
  110. /* There is no partial spec, and MSVC breaks on simulating it for iterator_traits queries */
  111. # define _STLP_USE_OLD_HP_ITERATOR_QUERIES
  112. # define _STLP_NO_TYPENAME_IN_TEMPLATE_HEADER
  113. # define _STLP_NO_METHOD_SPECIALIZATION 1
  114. # define _STLP_DEF_CONST_PLCT_NEW_BUG 1
  115. # define _STLP_NO_TYPENAME_ON_RETURN_TYPE 1
  116. /* VC++ cannot handle default allocator argument in template constructors */
  117. # define _STLP_NEEDS_EXTRA_TEMPLATE_CONSTRUCTORS
  118. # define _STLP_NO_QUALIFIED_FRIENDS 1
  119. # endif
  120. # if (_STLP_MSVC < 1300) /* including MSVC 6.0 */
  121. # define _STLP_NO_MEMBER_TEMPLATE_KEYWORD 1
  122. # define _STLP_DONT_SUPPORT_REBIND_MEMBER_TEMPLATE 1
  123. # endif
  124. # define _STLP_HAS_NATIVE_FLOAT_ABS 1
  125. // TODO: some eVC4 compilers report _MSC_VER 1201 or 1202, which category do they belong to?
  126. # if (_STLP_MSVC > 1200) && (_STLP_MSVC < 1310)
  127. # define _STLP_NO_MOVE_SEMANTIC
  128. # endif
  129. # if (_STLP_MSVC < 1300)
  130. /* TODO: remove this if it is handled and documented elsewhere
  131. * dums: VC6 do not handle correctly member templates of class that are explicitely
  132. * instanciated to be exported. There is a workaround, seperate the non template methods
  133. * from the template ones within 2 different classes and only export the non template one.
  134. * It is implemented for basic_string and locale at the writing of this note.
  135. * However this problem hos not been considered as important enough to remove template member
  136. * methods for other classes. Moreover Boost (www.boost.org) required it to be granted.
  137. * The workaround is activated thanks to the _STLP_USE_MSVC6_MEM_T_BUG_WORKAROUND macro defined
  138. * later in this config file.
  139. */
  140. /*
  141. # if defined (_DLL)
  142. # define _STLP_NO_MEMBER_TEMPLATES 1
  143. # endif
  144. */
  145. /* Boris : not defining this macro for SP5 causes other problems */
  146. /*# if !defined (_MSC_FULL_VER) || (_MSC_FULL_VER < 12008804 ) */
  147. # define _STLP_NO_USING_FOR_GLOBAL_FUNCTIONS 1
  148. /*# endif */
  149. # define _STLP_DONT_USE_BOOL_TYPEDEF 1
  150. # define _STLP_DONT_RETURN_VOID 1
  151. # endif
  152. # if (_STLP_MSVC < 1300) /* MSVC 6.0 and earlier */
  153. # define _STLP_NO_EXPLICIT_FUNCTION_TMPL_ARGS 1
  154. /* defined for DEBUG and NDEBUG too, to allow user mix own debug build with STLP release library */
  155. # define _STLP_USE_ABBREVS
  156. # endif
  157. #endif /* _STLP_MSVC */
  158. /* The desktop variants starting with VC8 have a set of more secure replacements
  159. * for the error-prone string handling functions of the C standard lib. */
  160. /* When user do not consider 'unsafe' string functions as deprecated using _CRT_SECURE_NO_DEPRECATE
  161. * macro we use 'unsafe' functions for performance reasons. */
  162. #if (_STLP_MSVC_LIB >= 1400) && !defined (_STLP_USING_PLATFORM_SDK_COMPILER) && !defined (UNDER_CE) && \
  163. !defined (_CRT_SECURE_NO_DEPRECATE)
  164. # define _STLP_USE_SAFE_STRING_FUNCTIONS 1
  165. #endif
  166. #if (_STLP_MSVC_LIB <= 1310)
  167. # define _STLP_VENDOR_GLOBAL_CSTD
  168. #endif
  169. #if (_STLP_MSVC_LIB >= 1300) && !defined(UNDER_CE)
  170. /* Starting with MSVC 7.0 and compilers simulating it,
  171. * we assume that the new SDK is granted:
  172. */
  173. # define _STLP_NEW_PLATFORM_SDK 1
  174. #endif
  175. #if (_STLP_MSVC_LIB < 1300) /* including MSVC 6.0 */
  176. # define _STLP_GLOBAL_NEW_HANDLER 1
  177. # define _STLP_VENDOR_UNEXPECTED_STD
  178. # define _STLP_NEW_DONT_THROW_BAD_ALLOC 1
  179. #endif
  180. #define _STLP_EXPORT_DECLSPEC __declspec(dllexport)
  181. #define _STLP_IMPORT_DECLSPEC __declspec(dllimport)
  182. #define _STLP_CLASS_EXPORT_DECLSPEC __declspec(dllexport)
  183. #define _STLP_CLASS_IMPORT_DECLSPEC __declspec(dllimport)
  184. #if defined (__DLL) || defined (_DLL) || defined (_RTLDLL) || defined (_AFXDLL)
  185. # define _STLP_RUNTIME_DLL
  186. #endif
  187. #if defined (__BUILDING_STLPORT) && \
  188. (defined (_STLP_USE_DYNAMIC_LIB) || \
  189. defined (_STLP_RUNTIME_DLL) && !defined (_STLP_USE_STATIC_LIB))
  190. # define _STLP_DLL
  191. #endif
  192. #include <stl/config/_detect_dll_or_lib.h>
  193. #undef _STLP_RUNTIME_DLL
  194. #undef _STLP_DLL
  195. #if defined (_STLP_USE_DYNAMIC_LIB)
  196. # undef _STLP_USE_DECLSPEC
  197. # define _STLP_USE_DECLSPEC 1
  198. # if defined (_STLP_MSVC) && (_STLP_MSVC < 1300)
  199. # define _STLP_USE_MSVC6_MEM_T_BUG_WORKAROUND 1
  200. # endif
  201. #endif
  202. #if !defined (_STLP_IMPORT_TEMPLATE_KEYWORD)
  203. # if !defined (_MSC_EXTENSIONS) || defined (_STLP_MSVC) && (_STLP_MSVC >= 1300)
  204. # define _STLP_IMPORT_TEMPLATE_KEYWORD
  205. # else
  206. # define _STLP_IMPORT_TEMPLATE_KEYWORD extern
  207. # endif
  208. #endif
  209. #define _STLP_EXPORT_TEMPLATE_KEYWORD
  210. #include <stl/config/_auto_link.h>
  211. #if defined (_STLP_USING_PLATFORM_SDK_COMPILER)
  212. /* The Windows 64 bits SDK required for the moment link to bufferoverflowU.lib for
  213. * additional buffer overrun checks. Rather than require the STLport build system and
  214. * users to explicitely link with it we use the MSVC auto link feature.
  215. */
  216. # if !defined (_STLP_DONT_USE_AUTO_LINK) || defined (__BUILDING_STLPORT)
  217. # pragma comment (lib, "bufferoverflowU.lib")
  218. # if defined (_STLP_VERBOSE)
  219. # pragma message ("STLport: Auto linking to bufferoverflowU.lib")
  220. # endif
  221. # endif
  222. #endif
  223. #if defined (_STLP_MSVC)
  224. # include <stl/config/_feedback.h>
  225. #endif