diff --git a/src/wc_regex_traits.cpp b/src/wc_regex_traits.cpp index aee2da18..1de3dee6 100644 --- a/src/wc_regex_traits.cpp +++ b/src/wc_regex_traits.cpp @@ -19,42 +19,56 @@ #define BOOST_REGEX_SOURCE -#include #include - -#ifdef _DLL_CPPLIB #include #include + +#if defined(_DLL_CPPLIB) && !defined(_M_CEE_PURE) // -// This is a horrible workaround, without declaring these symbols extern we get +// This is a horrible workaround, but without declaring these symbols extern we get // duplicate symbol errors when linking if the application is built without // /Zc:wchar_t // +#ifdef _CRTIMP2_PURE +# define BOOST_REGEX_STDLIB_DECL _CRTIMP2_PURE +#else +# define BOOST_REGEX_STDLIB_DECL _CRTIMP2 +#endif + namespace std{ -template _CRTIMP2 bool __cdecl operator==( + +#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) +template BOOST_REGEX_STDLIB_DECL allocator::allocator(); +template class BOOST_REGEX_STDLIB_DECL _String_val >; +template class BOOST_REGEX_STDLIB_DECL basic_string, + allocator >; +#endif + +#if BOOST_WORKAROUND(BOOST_MSVC, > 1300) && BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1400)) +template<> BOOST_REGEX_STDLIB_DECL std::size_t __cdecl char_traits::length(unsigned short const*); +#endif + +template BOOST_REGEX_STDLIB_DECL bool __cdecl operator==( const basic_string, allocator >&, const basic_string, allocator >&); -template _CRTIMP2 bool __cdecl operator==( +template BOOST_REGEX_STDLIB_DECL bool __cdecl operator==( const unsigned short *, const basic_string, allocator >&); -template _CRTIMP2 bool __cdecl operator==( +template BOOST_REGEX_STDLIB_DECL bool __cdecl operator==( const basic_string, allocator >&, const unsigned short *); -template _CRTIMP2 bool __cdecl operator<( +template BOOST_REGEX_STDLIB_DECL bool __cdecl operator<( const basic_string, allocator >&, const basic_string, allocator >&); -template _CRTIMP2 bool __cdecl operator>( +template BOOST_REGEX_STDLIB_DECL bool __cdecl operator>( const basic_string, allocator >&, const basic_string, allocator >&); -#if BOOST_WORKAROUND(BOOST_MSVC, > 1300) && BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1400)) -template<> _CRTIMP2 std::size_t __cdecl char_traits::length(unsigned short const*); -#endif -#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) -template _CRTIMP2 allocator::allocator(); -#endif } #endif +#include +#include + #if !BOOST_WORKAROUND(__BORLANDC__, < 0x560) #include