Boost logo

Boost-Commit :

From: john_at_[hidden]
Date: 2008-08-19 11:54:39


Author: johnmaddock
Date: 2008-08-19 11:54:39 EDT (Tue, 19 Aug 2008)
New Revision: 48220
URL: http://svn.boost.org/trac/boost/changeset/48220

Log:
Fix for VC8 without the service pack.
Text files modified:
   trunk/libs/regex/src/usinstances.cpp | 49 +++++++++++++++++++++++++--------------
   1 files changed, 31 insertions(+), 18 deletions(-)

Modified: trunk/libs/regex/src/usinstances.cpp
==============================================================================
--- trunk/libs/regex/src/usinstances.cpp (original)
+++ trunk/libs/regex/src/usinstances.cpp 2008-08-19 11:54:39 EDT (Tue, 19 Aug 2008)
@@ -18,45 +18,58 @@
 
 #define BOOST_REGEX_SOURCE
 
-#include <boost/regex/config.hpp>
-
-#if !defined(BOOST_NO_WREGEX) && defined(BOOST_REGEX_HAS_OTHER_WCHAR_T) && !defined(BOOST_REGEX_NO_EXTERNAL_TEMPLATES)
-#define BOOST_REGEX_US_INSTANTIATE
-
-#ifdef _DLL_CPPLIB
 #include <boost/detail/workaround.hpp>
 #include <memory>
 #include <string>
+
+#if defined(_DLL_CPPLIB) && !defined(_M_CEE_PURE) \
+ && !(defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION) || defined(__STD_RWCOMPILER_H__) || defined(_RWSTD_VER))
 //
-// 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 class BOOST_REGEX_STDLIB_DECL allocator<unsigned short>;
+template class BOOST_REGEX_STDLIB_DECL _String_val<unsigned short, allocator<unsigned short> >;
+template class BOOST_REGEX_STDLIB_DECL basic_string<unsigned short, char_traits<unsigned short>,
+ allocator<unsigned short> >;
+#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<unsigned short>::length(unsigned short const*);
+#endif
+
+template BOOST_REGEX_STDLIB_DECL bool __cdecl operator==(
    const basic_string<unsigned short, char_traits<unsigned short>, allocator<unsigned short> >&,
    const basic_string<unsigned short, char_traits<unsigned short>, allocator<unsigned short> >&);
-template _CRTIMP2 bool __cdecl operator==(
+template BOOST_REGEX_STDLIB_DECL bool __cdecl operator==(
    const unsigned short *,
    const basic_string<unsigned short, char_traits<unsigned short>, allocator<unsigned short> >&);
-template _CRTIMP2 bool __cdecl operator==(
+template BOOST_REGEX_STDLIB_DECL bool __cdecl operator==(
    const basic_string<unsigned short, char_traits<unsigned short>, allocator<unsigned short> >&,
    const unsigned short *);
-template _CRTIMP2 bool __cdecl operator<(
+template BOOST_REGEX_STDLIB_DECL bool __cdecl operator<(
    const basic_string<unsigned short, char_traits<unsigned short>, allocator<unsigned short> >&,
    const basic_string<unsigned short, char_traits<unsigned short>, allocator<unsigned short> >&);
-template _CRTIMP2 bool __cdecl operator>(
+template BOOST_REGEX_STDLIB_DECL bool __cdecl operator>(
    const basic_string<unsigned short, char_traits<unsigned short>, allocator<unsigned short> >&,
    const basic_string<unsigned short, char_traits<unsigned short>, allocator<unsigned short> >&);
-#if BOOST_WORKAROUND(BOOST_MSVC, > 1300) && BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1400))
-template<> _CRTIMP2 std::size_t __cdecl char_traits<unsigned short>::length(unsigned short const*);
-#endif
-#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400)
-template _CRTIMP2 allocator<unsigned short>::allocator();
-#endif
 }
 #endif
 
+#include <boost/regex/config.hpp>
+
+#if !defined(BOOST_NO_WREGEX) && defined(BOOST_REGEX_HAS_OTHER_WCHAR_T) && !defined(BOOST_REGEX_NO_EXTERNAL_TEMPLATES)
+#define BOOST_REGEX_US_INSTANTIATE
 
 #include <boost/regex.hpp>
 


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk