From e7b65221d1ce37151b7ab4cc8de38f8cbd06bf45 Mon Sep 17 00:00:00 2001 From: John Maddock Date: Fri, 10 Aug 2007 10:11:03 +0000 Subject: [PATCH] Tidied up msvc-warning suppression code. [SVN r38562] --- include/boost/regex/config.hpp | 6 ++++++ include/boost/regex/pattern_except.hpp | 5 ++++- include/boost/regex/v4/basic_regex.hpp | 2 +- include/boost/regex/v4/basic_regex_creator.hpp | 9 +++++++++ include/boost/regex/v4/basic_regex_parser.hpp | 2 +- include/boost/regex/v4/perl_matcher.hpp | 9 +++++++++ include/boost/regex/v4/perl_matcher_common.hpp | 8 ++++++++ include/boost/regex/v4/perl_matcher_non_recursive.hpp | 8 ++++++++ include/boost/regex/v4/regex_split.hpp | 9 +++++++++ include/boost/regex/v4/regex_workaround.hpp | 8 ++------ include/boost/regex/v4/w32_regex_traits.hpp | 1 + 11 files changed, 58 insertions(+), 9 deletions(-) diff --git a/include/boost/regex/config.hpp b/include/boost/regex/config.hpp index 0e229f50..9f95a336 100644 --- a/include/boost/regex/config.hpp +++ b/include/boost/regex/config.hpp @@ -86,6 +86,12 @@ #if defined(BOOST_INTEL) && defined(__cplusplus) && (BOOST_INTEL <= 800) # define BOOST_REGEX_NO_EXTERNAL_TEMPLATES #endif +/* + * Visual C++ doesn't support external templates with C++ extensions turned off: + */ +#if defined(_MSC_VER) && !defined(_MSC_EXTENSIONS) +# define BOOST_REGEX_NO_EXTERNAL_TEMPLATES +#endif /* * If there isn't good enough wide character support then there will diff --git a/include/boost/regex/pattern_except.hpp b/include/boost/regex/pattern_except.hpp index 25cab1cc..1ac85307 100644 --- a/include/boost/regex/pattern_except.hpp +++ b/include/boost/regex/pattern_except.hpp @@ -37,7 +37,7 @@ namespace boost{ #pragma warning(push) #pragma warning(disable : 4275) #endif - class BOOST_REGEX_DECL regex_error : public std::runtime_error +class BOOST_REGEX_DECL regex_error : public std::runtime_error { public: explicit regex_error(const std::string& s, regex_constants::error_type err = regex_constants::error_unknown, std::ptrdiff_t pos = 0); @@ -70,6 +70,9 @@ void raise_error(const traits& t, regex_constants::error_type code) } +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_SUFFIX diff --git a/include/boost/regex/v4/basic_regex.hpp b/include/boost/regex/v4/basic_regex.hpp index 665c1a95..b21a7c66 100644 --- a/include/boost/regex/v4/basic_regex.hpp +++ b/include/boost/regex/v4/basic_regex.hpp @@ -26,7 +26,7 @@ namespace boost{ #ifdef BOOST_MSVC #pragma warning(push) -#pragma warning(disable : 4251 4231 4660) +#pragma warning(disable : 4251 4231 4660 4800) #endif namespace re_detail{ diff --git a/include/boost/regex/v4/basic_regex_creator.hpp b/include/boost/regex/v4/basic_regex_creator.hpp index a03c9520..37b26ca8 100644 --- a/include/boost/regex/v4/basic_regex_creator.hpp +++ b/include/boost/regex/v4/basic_regex_creator.hpp @@ -24,6 +24,11 @@ # include BOOST_ABI_PREFIX #endif +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable: 4800) +#endif + namespace boost{ namespace re_detail{ @@ -1289,6 +1294,10 @@ void basic_regex_creator::probe_leading_repeat(re_syntax_base* st } // namespace boost +#ifdef BOOST_MSVC +# pragma warning(pop) +#endif + #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_SUFFIX #endif diff --git a/include/boost/regex/v4/basic_regex_parser.hpp b/include/boost/regex/v4/basic_regex_parser.hpp index 08e705ad..2e854b19 100644 --- a/include/boost/regex/v4/basic_regex_parser.hpp +++ b/include/boost/regex/v4/basic_regex_parser.hpp @@ -28,7 +28,7 @@ namespace re_detail{ #ifdef BOOST_MSVC #pragma warning(push) -#pragma warning(disable:4244) +#pragma warning(disable:4244 4800) #endif template diff --git a/include/boost/regex/v4/perl_matcher.hpp b/include/boost/regex/v4/perl_matcher.hpp index 99b3a9a8..aaeca5c7 100644 --- a/include/boost/regex/v4/perl_matcher.hpp +++ b/include/boost/regex/v4/perl_matcher.hpp @@ -18,6 +18,11 @@ # include BOOST_ABI_PREFIX #endif +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable: 4800) +#endif + namespace boost{ namespace re_detail{ @@ -512,6 +517,10 @@ private: } // namespace boost +#ifdef BOOST_MSVC +# pragma warning(pop) +#endif + // // include the implementation of perl_matcher: // diff --git a/include/boost/regex/v4/perl_matcher_common.hpp b/include/boost/regex/v4/perl_matcher_common.hpp index 1c222b87..cb6a90af 100644 --- a/include/boost/regex/v4/perl_matcher_common.hpp +++ b/include/boost/regex/v4/perl_matcher_common.hpp @@ -27,6 +27,10 @@ #ifdef __BORLANDC__ # pragma option push -w-8008 -w-8066 #endif +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable: 4800) +#endif namespace boost{ namespace re_detail{ @@ -938,6 +942,10 @@ bool perl_matcher::find_restart_lit() } // namespace boost +#ifdef BOOST_MSVC +# pragma warning(pop) +#endif + #ifdef __BORLANDC__ # pragma option pop #endif diff --git a/include/boost/regex/v4/perl_matcher_non_recursive.hpp b/include/boost/regex/v4/perl_matcher_non_recursive.hpp index c055b383..bcd62c3c 100644 --- a/include/boost/regex/v4/perl_matcher_non_recursive.hpp +++ b/include/boost/regex/v4/perl_matcher_non_recursive.hpp @@ -25,6 +25,10 @@ #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_PREFIX #endif +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable: 4800) +#endif namespace boost{ namespace re_detail{ @@ -1358,6 +1362,10 @@ bool perl_matcher::unwind_non_greedy_repeat(boo } // namespace re_detail } // namespace boost +#ifdef BOOST_MSVC +# pragma warning(pop) +#endif + #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_SUFFIX #endif diff --git a/include/boost/regex/v4/regex_split.hpp b/include/boost/regex/v4/regex_split.hpp index 60e13e33..6683e421 100644 --- a/include/boost/regex/v4/regex_split.hpp +++ b/include/boost/regex/v4/regex_split.hpp @@ -27,6 +27,11 @@ namespace boost{ # include BOOST_ABI_PREFIX #endif +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable: 4800) +#endif + namespace re_detail{ template @@ -138,6 +143,10 @@ inline std::size_t regex_split(OutputIterator out, return regex_split(out, s, re_detail::get_default_expression(charT(0)), match_default, UINT_MAX); } +#ifdef BOOST_MSVC +# pragma warning(pop) +#endif + #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_SUFFIX #endif diff --git a/include/boost/regex/v4/regex_workaround.hpp b/include/boost/regex/v4/regex_workaround.hpp index 3b5a46f4..917320ca 100644 --- a/include/boost/regex/v4/regex_workaround.hpp +++ b/include/boost/regex/v4/regex_workaround.hpp @@ -66,11 +66,6 @@ using std::distance; #ifdef BOOST_REGEX_NO_BOOL # define BOOST_REGEX_MAKE_BOOL(x) static_cast((x) ? true : false) #else -# ifdef BOOST_MSVC - // warning suppression with VC6: -# pragma warning(disable: 4800) -# pragma warning(disable: 4786) -# endif # define BOOST_REGEX_MAKE_BOOL(x) static_cast(x) #endif @@ -197,7 +192,8 @@ namespace boost{ namespace re_detail{ } }} // namespaces -#endif + +#endif // __cplusplus #endif // include guard diff --git a/include/boost/regex/v4/w32_regex_traits.hpp b/include/boost/regex/v4/w32_regex_traits.hpp index 8a85d683..a0f9b0f6 100644 --- a/include/boost/regex/v4/w32_regex_traits.hpp +++ b/include/boost/regex/v4/w32_regex_traits.hpp @@ -42,6 +42,7 @@ #ifdef BOOST_MSVC #pragma warning(push) #pragma warning(disable:4786) +#pragma warning(disable:4800) #endif namespace boost{