diff --git a/include/boost/regex/config.hpp b/include/boost/regex/config.hpp index 0e229f50..8c8f5248 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 @@ -152,7 +158,7 @@ * of the non-inline functions in the library, so that users can still link to the lib, * irrespective of whether their own code is built with /Zc:wchar_t. */ -#if defined(__cplusplus) && (defined(BOOST_MSVC) || defined(__ICL)) && !defined(BOOST_NO_INTRINSIC_WCHAR_T) && defined(BOOST_WINDOWS) && !defined(__SGI_STL_PORT) && !defined(_STLPORT_VERSION) +#if defined(__cplusplus) && (defined(BOOST_MSVC) || defined(__ICL)) && !defined(BOOST_NO_INTRINSIC_WCHAR_T) && defined(BOOST_WINDOWS) && !defined(__SGI_STL_PORT) && !defined(_STLPORT_VERSION) && !defined(BOOST_RWSTD_VER) # define BOOST_REGEX_HAS_OTHER_WCHAR_T # ifdef BOOST_MSVC # pragma warning(push) diff --git a/include/boost/regex/pattern_except.hpp b/include/boost/regex/pattern_except.hpp index 25cab1cc..57ea14c2 100644 --- a/include/boost/regex/pattern_except.hpp +++ b/include/boost/regex/pattern_except.hpp @@ -29,15 +29,22 @@ namespace boost{ +#ifdef BOOST_MSVC +#pragma warning(push) +#pragma warning(disable: 4103) +#endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_PREFIX #endif +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif #ifdef BOOST_MSVC #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,10 +77,20 @@ void raise_error(const traits& t, regex_constants::error_type code) } +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif +#ifdef BOOST_MSVC +#pragma warning(push) +#pragma warning(disable: 4103) +#endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_SUFFIX #endif +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif } // namespace boost diff --git a/include/boost/regex/pending/static_mutex.hpp b/include/boost/regex/pending/static_mutex.hpp index 8dbf48e7..218169c3 100644 --- a/include/boost/regex/pending/static_mutex.hpp +++ b/include/boost/regex/pending/static_mutex.hpp @@ -127,8 +127,15 @@ inline bool scoped_static_mutex_lock::locked()const // down to the initialisation proceedure. In fact the initialisation routine // may need to be called more than once - but only once per instance. // -#include -#include +// Since this preprocessor path is almost never taken, we hide these header +// dependencies so that build tools don't find them. +// +#define B1 +#define B2 +#include B1 +#include B2 +#undef B1 +#undef B2 namespace boost{ diff --git a/include/boost/regex/v4/basic_regex.hpp b/include/boost/regex/v4/basic_regex.hpp index c6ef4002..2a8c0c6c 100644 --- a/include/boost/regex/v4/basic_regex.hpp +++ b/include/boost/regex/v4/basic_regex.hpp @@ -19,14 +19,21 @@ #ifndef BOOST_REGEX_V4_BASIC_REGEX_HPP #define BOOST_REGEX_V4_BASIC_REGEX_HPP +#ifdef BOOST_MSVC +#pragma warning(push) +#pragma warning(disable: 4103) +#endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_PREFIX #endif +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif 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{ @@ -630,9 +637,16 @@ public: } // namespace boost +#ifdef BOOST_MSVC +#pragma warning(push) +#pragma warning(disable: 4103) +#endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_SUFFIX #endif +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif #endif diff --git a/include/boost/regex/v4/basic_regex_creator.hpp b/include/boost/regex/v4/basic_regex_creator.hpp index a03c9520..fec755f8 100644 --- a/include/boost/regex/v4/basic_regex_creator.hpp +++ b/include/boost/regex/v4/basic_regex_creator.hpp @@ -20,9 +20,21 @@ #ifndef BOOST_REGEX_V4_BASIC_REGEX_CREATOR_HPP #define BOOST_REGEX_V4_BASIC_REGEX_CREATOR_HPP +#ifdef BOOST_MSVC +#pragma warning(push) +#pragma warning(disable: 4103) +#endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_PREFIX #endif +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif + +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable: 4800) +#endif namespace boost{ @@ -1289,8 +1301,19 @@ void basic_regex_creator::probe_leading_repeat(re_syntax_base* st } // namespace boost +#ifdef BOOST_MSVC +# pragma warning(pop) +#endif + +#ifdef BOOST_MSVC +#pragma warning(push) +#pragma warning(disable: 4103) +#endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_SUFFIX #endif +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif #endif diff --git a/include/boost/regex/v4/basic_regex_parser.hpp b/include/boost/regex/v4/basic_regex_parser.hpp index 08e705ad..fcf512c2 100644 --- a/include/boost/regex/v4/basic_regex_parser.hpp +++ b/include/boost/regex/v4/basic_regex_parser.hpp @@ -19,16 +19,23 @@ #ifndef BOOST_REGEX_V4_BASIC_REGEX_PARSER_HPP #define BOOST_REGEX_V4_BASIC_REGEX_PARSER_HPP +#ifdef BOOST_MSVC +#pragma warning(push) +#pragma warning(disable: 4103) +#endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_PREFIX #endif +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif namespace boost{ namespace re_detail{ #ifdef BOOST_MSVC #pragma warning(push) -#pragma warning(disable:4244) +#pragma warning(disable:4244 4800) #endif template @@ -2082,8 +2089,15 @@ bool basic_regex_parser::unwind_alts(std::ptrdiff_t last_paren_st } // namespace re_detail } // namespace boost +#ifdef BOOST_MSVC +#pragma warning(push) +#pragma warning(disable: 4103) +#endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_SUFFIX #endif +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif #endif diff --git a/include/boost/regex/v4/c_regex_traits.hpp b/include/boost/regex/v4/c_regex_traits.hpp index b4ec1518..d99b0f34 100644 --- a/include/boost/regex/v4/c_regex_traits.hpp +++ b/include/boost/regex/v4/c_regex_traits.hpp @@ -34,9 +34,16 @@ namespace std{ } #endif +#ifdef BOOST_MSVC +#pragma warning(push) +#pragma warning(disable: 4103) +#endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_PREFIX #endif +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif namespace boost{ @@ -187,9 +194,16 @@ private: } +#ifdef BOOST_MSVC +#pragma warning(push) +#pragma warning(disable: 4103) +#endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_SUFFIX #endif +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif #endif diff --git a/include/boost/regex/v4/char_regex_traits.hpp b/include/boost/regex/v4/char_regex_traits.hpp index f00e65eb..e8a501ca 100644 --- a/include/boost/regex/v4/char_regex_traits.hpp +++ b/include/boost/regex/v4/char_regex_traits.hpp @@ -20,9 +20,16 @@ #ifndef BOOST_REGEX_V4_CHAR_REGEX_TRAITS_HPP #define BOOST_REGEX_V4_CHAR_REGEX_TRAITS_HPP +#ifdef BOOST_MSVC +#pragma warning(push) +#pragma warning(disable: 4103) +#endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_PREFIX #endif +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif namespace boost{ @@ -59,9 +66,16 @@ public: } // namespace deprecated } // namespace boost +#ifdef BOOST_MSVC +#pragma warning(push) +#pragma warning(disable: 4103) +#endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_SUFFIX #endif +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif #endif // include diff --git a/include/boost/regex/v4/cpp_regex_traits.hpp b/include/boost/regex/v4/cpp_regex_traits.hpp index bbe5c508..dbec293c 100644 --- a/include/boost/regex/v4/cpp_regex_traits.hpp +++ b/include/boost/regex/v4/cpp_regex_traits.hpp @@ -41,10 +41,18 @@ #include #include +#include +#ifdef BOOST_MSVC +#pragma warning(push) +#pragma warning(disable: 4103) +#endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_PREFIX #endif +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif #ifdef BOOST_MSVC #pragma warning(push) @@ -1032,10 +1040,18 @@ static_mutex& cpp_regex_traits::get_mutex_inst() #pragma warning(pop) #endif +#ifdef BOOST_MSVC +#pragma warning(push) +#pragma warning(disable: 4103) +#endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_SUFFIX #endif - +#ifdef BOOST_MSVC +#pragma warning(pop) #endif #endif + +#endif + diff --git a/include/boost/regex/v4/cregex.hpp b/include/boost/regex/v4/cregex.hpp index 17818ec5..cafe396c 100644 --- a/include/boost/regex/v4/cregex.hpp +++ b/include/boost/regex/v4/cregex.hpp @@ -32,9 +32,16 @@ #include #endif +#ifdef BOOST_MSVC +#pragma warning(push) +#pragma warning(disable: 4103) +#endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_PREFIX #endif +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif /* include these defs only for POSIX compatablity */ #ifdef __cplusplus @@ -176,9 +183,16 @@ BOOST_REGEX_DECL void BOOST_REGEX_CCALL regfreeW(regex_tW*); #define regex_t regex_tA #endif +#ifdef BOOST_MSVC +#pragma warning(push) +#pragma warning(disable: 4103) +#endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_SUFFIX #endif +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif #ifdef __cplusplus } // extern "C" @@ -193,9 +207,16 @@ BOOST_REGEX_DECL void BOOST_REGEX_CCALL regfreeW(regex_tW*); #include namespace boost{ +#ifdef BOOST_MSVC +#pragma warning(push) +#pragma warning(disable: 4103) +#endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_PREFIX #endif +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif class RegEx; @@ -280,9 +301,16 @@ public: friend struct re_detail::pred4; }; +#ifdef BOOST_MSVC +#pragma warning(push) +#pragma warning(disable: 4103) +#endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_SUFFIX #endif +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif } // namespace boost diff --git a/include/boost/regex/v4/fileiter.hpp b/include/boost/regex/v4/fileiter.hpp index 21a785ea..f13c4b2f 100644 --- a/include/boost/regex/v4/fileiter.hpp +++ b/include/boost/regex/v4/fileiter.hpp @@ -46,10 +46,16 @@ #if defined(BOOST_REGEX_FI_WIN32_DIR) +#include + namespace boost{ namespace re_detail{ +#ifndef BOOST_NO_ANSI_APIS typedef WIN32_FIND_DATAA _fi_find_data; +#else +typedef WIN32_FIND_DATAW _fi_find_data; +#endif typedef HANDLE _fi_find_handle; } // namespace re_detail diff --git a/include/boost/regex/v4/iterator_traits.hpp b/include/boost/regex/v4/iterator_traits.hpp index 7e247f53..f7afacb1 100644 --- a/include/boost/regex/v4/iterator_traits.hpp +++ b/include/boost/regex/v4/iterator_traits.hpp @@ -19,9 +19,16 @@ #ifndef BOOST_REGEX_V4_ITERATOR_TRAITS_HPP #define BOOST_REGEX_V4_ITERATOR_TRAITS_HPP +#ifdef BOOST_MSVC +#pragma warning(push) +#pragma warning(disable: 4103) +#endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_PREFIX #endif +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif namespace boost{ namespace re_detail{ @@ -113,9 +120,16 @@ struct regex_iterator_traits : public std::iterator_traits {}; } // namespace re_detail } // namespace boost +#ifdef BOOST_MSVC +#pragma warning(push) +#pragma warning(disable: 4103) +#endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_SUFFIX #endif +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif #endif diff --git a/include/boost/regex/v4/match_flags.hpp b/include/boost/regex/v4/match_flags.hpp index a86fe461..9585aca8 100644 --- a/include/boost/regex/v4/match_flags.hpp +++ b/include/boost/regex/v4/match_flags.hpp @@ -23,8 +23,6 @@ # include #endif -#include - #ifdef __cplusplus namespace boost{ namespace regex_constants{ @@ -73,7 +71,7 @@ typedef enum _match_flags } match_flags; -#if BOOST_WORKAROUND(BOOST_MSVC, < 1300) || BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) +#if (defined(_MSC_VER) && (_MSC_VER < 1300)) || defined(__BORLANDC__) typedef unsigned long match_flag_type; #else typedef match_flags match_flag_type; diff --git a/include/boost/regex/v4/match_results.hpp b/include/boost/regex/v4/match_results.hpp index f56c4941..acf509fa 100644 --- a/include/boost/regex/v4/match_results.hpp +++ b/include/boost/regex/v4/match_results.hpp @@ -19,9 +19,16 @@ #ifndef BOOST_REGEX_V4_MATCH_RESULTS_HPP #define BOOST_REGEX_V4_MATCH_RESULTS_HPP +#ifdef BOOST_MSVC +#pragma warning(push) +#pragma warning(disable: 4103) +#endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_PREFIX #endif +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif namespace boost{ #ifdef BOOST_MSVC @@ -404,9 +411,16 @@ std::ostream& operator << (std::ostream& os, #endif } // namespace boost +#ifdef BOOST_MSVC +#pragma warning(push) +#pragma warning(disable: 4103) +#endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_SUFFIX #endif +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif #endif diff --git a/include/boost/regex/v4/perl_matcher.hpp b/include/boost/regex/v4/perl_matcher.hpp index 73a046c6..547cb24a 100644 --- a/include/boost/regex/v4/perl_matcher.hpp +++ b/include/boost/regex/v4/perl_matcher.hpp @@ -14,9 +14,21 @@ #include +#ifdef BOOST_MSVC +#pragma warning(push) +#pragma warning(disable: 4103) +#endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_PREFIX #endif +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif + +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable: 4800) +#endif namespace boost{ namespace re_detail{ @@ -49,7 +61,7 @@ inline bool can_start(unsigned short c, const unsigned char* map, unsigned char { return ((c >= (1 << CHAR_BIT)) ? true : map[c] & mask); } -#if !defined(__hpux) // can't use WCHAR_MIN in pp-directive +#if !defined(__hpux) // WCHAR_MIN not usable in pp-directives. #if defined(WCHAR_MIN) && (WCHAR_MIN == 0) && !defined(BOOST_NO_INTRINSIC_WCHAR_T) inline bool can_start(wchar_t c, const unsigned char* map, unsigned char mask) { @@ -506,12 +518,23 @@ private: } // namespace re_detail +#ifdef BOOST_MSVC +#pragma warning(push) +#pragma warning(disable: 4103) +#endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_SUFFIX #endif +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif } // 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..72e43d00 100644 --- a/include/boost/regex/v4/perl_matcher_common.hpp +++ b/include/boost/regex/v4/perl_matcher_common.hpp @@ -20,13 +20,24 @@ #ifndef BOOST_REGEX_V4_PERL_MATCHER_COMMON_HPP #define BOOST_REGEX_V4_PERL_MATCHER_COMMON_HPP +#ifdef BOOST_MSVC +#pragma warning(push) +#pragma warning(disable: 4103) +#endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_PREFIX #endif +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif #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,12 +949,23 @@ bool perl_matcher::find_restart_lit() } // namespace boost +#ifdef BOOST_MSVC +# pragma warning(pop) +#endif + #ifdef __BORLANDC__ # pragma option pop #endif +#ifdef BOOST_MSVC +#pragma warning(push) +#pragma warning(disable: 4103) +#endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_SUFFIX #endif +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif #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..3bf34601 100644 --- a/include/boost/regex/v4/perl_matcher_non_recursive.hpp +++ b/include/boost/regex/v4/perl_matcher_non_recursive.hpp @@ -22,9 +22,20 @@ #include +#ifdef BOOST_MSVC +#pragma warning(push) +#pragma warning(disable: 4103) +#endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_PREFIX #endif +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable: 4800) +#endif namespace boost{ namespace re_detail{ @@ -1358,9 +1369,20 @@ bool perl_matcher::unwind_non_greedy_repeat(boo } // namespace re_detail } // namespace boost +#ifdef BOOST_MSVC +# pragma warning(pop) +#endif + +#ifdef BOOST_MSVC +#pragma warning(push) +#pragma warning(disable: 4103) +#endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_SUFFIX #endif +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif #endif diff --git a/include/boost/regex/v4/perl_matcher_recursive.hpp b/include/boost/regex/v4/perl_matcher_recursive.hpp index 1e98b342..746d02ab 100644 --- a/include/boost/regex/v4/perl_matcher_recursive.hpp +++ b/include/boost/regex/v4/perl_matcher_recursive.hpp @@ -20,9 +20,21 @@ #ifndef BOOST_REGEX_V4_PERL_MATCHER_RECURSIVE_HPP #define BOOST_REGEX_V4_PERL_MATCHER_RECURSIVE_HPP +#ifdef BOOST_MSVC +#pragma warning(push) +#pragma warning(disable: 4103) +#endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_PREFIX #endif +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif + +#ifdef BOOST_MSVC +#pragma warning(push) +#pragma warning(disable: 4800) +#endif namespace boost{ namespace re_detail{ @@ -823,10 +835,20 @@ bool perl_matcher::backtrack_till_match(std::si } // namespace re_detail } // namespace boost +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif +#ifdef BOOST_MSVC +#pragma warning(push) +#pragma warning(disable: 4103) +#endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_SUFFIX #endif +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif #endif diff --git a/include/boost/regex/v4/primary_transform.hpp b/include/boost/regex/v4/primary_transform.hpp index e498b63b..989f500c 100644 --- a/include/boost/regex/v4/primary_transform.hpp +++ b/include/boost/regex/v4/primary_transform.hpp @@ -20,9 +20,16 @@ #ifndef BOOST_REGEX_PRIMARY_TRANSFORM #define BOOST_REGEX_PRIMARY_TRANSFORM +#ifdef BOOST_MSVC +#pragma warning(push) +#pragma warning(disable: 4103) +#endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_PREFIX #endif +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif namespace boost{ namespace re_detail{ @@ -118,9 +125,16 @@ unsigned find_sort_syntax(const traits* pt, charT* delim) } // namespace re_detail } // namespace boost +#ifdef BOOST_MSVC +#pragma warning(push) +#pragma warning(disable: 4103) +#endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_SUFFIX #endif +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif #endif diff --git a/include/boost/regex/v4/protected_call.hpp b/include/boost/regex/v4/protected_call.hpp index 197c4556..ebf15ba3 100644 --- a/include/boost/regex/v4/protected_call.hpp +++ b/include/boost/regex/v4/protected_call.hpp @@ -20,9 +20,16 @@ #ifndef BOOST_REGEX_V4_PROTECTED_CALL_HPP #define BOOST_REGEX_V4_PROTECTED_CALL_HPP +#ifdef BOOST_MSVC +#pragma warning(push) +#pragma warning(disable: 4103) +#endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_PREFIX #endif +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif namespace boost{ namespace re_detail{ @@ -60,8 +67,15 @@ bool concrete_protected_call::call()const } } // namespace boost +#ifdef BOOST_MSVC +#pragma warning(push) +#pragma warning(disable: 4103) +#endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_SUFFIX #endif +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif #endif diff --git a/include/boost/regex/v4/regbase.hpp b/include/boost/regex/v4/regbase.hpp index 4c6bde83..d27799c3 100644 --- a/include/boost/regex/v4/regbase.hpp +++ b/include/boost/regex/v4/regbase.hpp @@ -19,9 +19,16 @@ #ifndef BOOST_REGEX_V4_REGBASE_HPP #define BOOST_REGEX_V4_REGBASE_HPP +#ifdef BOOST_MSVC +#pragma warning(push) +#pragma warning(disable: 4103) +#endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_PREFIX #endif +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif namespace boost{ // @@ -154,9 +161,16 @@ namespace regex_constants{ } // namespace boost +#ifdef BOOST_MSVC +#pragma warning(push) +#pragma warning(disable: 4103) +#endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_SUFFIX #endif +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif #endif diff --git a/include/boost/regex/v4/regex_cstring.hpp b/include/boost/regex/v4/regex_cstring.hpp deleted file mode 100644 index 589380d6..00000000 --- a/include/boost/regex/v4/regex_cstring.hpp +++ /dev/null @@ -1,123 +0,0 @@ -/* - * - * Copyright (c) 1998-2002 - * John Maddock - * - * Use, modification and distribution are subject to the - * Boost Software License, Version 1.0. (See accompanying file - * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - * - */ - - /* - * LOCATION: see http://www.boost.org for most recent version. - * FILE regex_cstring.hpp - * VERSION see - * DESCRIPTION: This is an internal header file, do not include directly. - * String support and helper functions, for regular - * expression library. - */ - -#ifndef BOOST_REGEX_CSTRING_HPP -#define BOOST_REGEX_CSTRING_HPP - -#ifndef BOOST_REGEX_CONFIG_HPP -#include -#endif - -#include - -namespace boost{ - namespace re_detail{ - -// -// start by defining some template function aliases for C API functions: -// - -template -std::size_t BOOST_REGEX_CALL re_strlen(const charT *s) -{ - std::size_t len = 0; - while(*s) - { - ++s; - ++len; - } - return len; -} - -inline std::size_t BOOST_REGEX_CALL re_strlen(const char *s) -{ - return std::strlen(s); -} - -#ifndef BOOST_NO_WREGEX - -inline std::size_t BOOST_REGEX_CALL re_strlen(const wchar_t *s) -{ - return std::wcslen(s); -} - -#endif - -#ifndef BOOST_NO_WREGEX -BOOST_REGEX_DECL void BOOST_REGEX_CALL re_transform(std::basic_string& out, const std::basic_string& in); -#endif -BOOST_REGEX_DECL void BOOST_REGEX_CALL re_transform(std::string& out, const std::string& in); - -template -void BOOST_REGEX_CALL re_trunc_primary(std::basic_string& s) -{ - for(unsigned int i = 0; i < s.size(); ++i) - { - if(s[i] <= 1) - { - s.erase(i); - break; - } - } -} - -inline char* BOOST_REGEX_CALL re_strcpy(char *s1, const char *s2) -{ - #if defined(__BORLANDC__) && defined(strcpy) - return ::strcpy(s1, s2); - #else - return std::strcpy(s1, s2); - #endif -} - -#ifndef BOOST_NO_WREGEX - -inline wchar_t* BOOST_REGEX_CALL re_strcpy(wchar_t *s1, const wchar_t *s2) -{ - return std::wcscpy(s1, s2); -} - -#endif - - -template -charT* BOOST_REGEX_CALL re_strdup(const charT* p) -{ - charT* buf = new charT[re_strlen(p) + 1]; - re_strcpy(buf, p); - return buf; -} - -template -inline void BOOST_REGEX_CALL re_strfree(charT* p) -{ - delete[] p; -} - -} // namespace re_detail -} // namespace boost - -#endif // BOOST_REGEX_CSTRING_HPP - - - - - - diff --git a/include/boost/regex/v4/regex_format.hpp b/include/boost/regex/v4/regex_format.hpp index 5bd47cf6..ea55ed66 100644 --- a/include/boost/regex/v4/regex_format.hpp +++ b/include/boost/regex/v4/regex_format.hpp @@ -24,9 +24,16 @@ namespace boost{ +#ifdef BOOST_MSVC +#pragma warning(push) +#pragma warning(disable: 4103) +#endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_PREFIX #endif +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif // // Forward declaration: @@ -75,7 +82,7 @@ class basic_regex_formatter public: typedef typename traits::char_type char_type; basic_regex_formatter(OutputIterator o, const Results& r, const traits& t) - : m_traits(t), m_results(r), m_out(o), m_state(output_copy), m_have_conditional(false) {} + : m_traits(t), m_results(r), m_out(o), m_state(output_copy), m_restore_state(output_copy), m_have_conditional(false) {} OutputIterator format(const char_type* p1, const char_type* p2, match_flag_type f); OutputIterator format(const char_type* p1, match_flag_type f) { @@ -108,6 +115,7 @@ private: const char_type* m_end; // format string end match_flag_type m_flags; // format flags to use output_state m_state; // what to do with the next character + output_state m_restore_state; // what state to restore to. bool m_have_conditional; // we are parsing a conditional private: basic_regex_formatter(const basic_regex_formatter&); @@ -362,6 +370,7 @@ void basic_regex_formatter::format_escape() { case 'l': ++m_position; + m_restore_state = m_state; m_state = output_next_lower; breakout = true; break; @@ -372,6 +381,7 @@ void basic_regex_formatter::format_escape() break; case 'u': ++m_position; + m_restore_state = m_state; m_state = output_next_upper; breakout = true; break; @@ -495,11 +505,11 @@ void basic_regex_formatter::put(char_type c) return; case output_next_lower: c = m_traits.tolower(c); - this->m_state = output_copy; + this->m_state = m_restore_state; break; case output_next_upper: c = m_traits.toupper(c); - this->m_state = output_copy; + this->m_state = m_restore_state; break; case output_lower: c = m_traits.tolower(c); @@ -622,9 +632,16 @@ std::basic_string regex_format(const match_results& m, return result; } +#ifdef BOOST_MSVC +#pragma warning(push) +#pragma warning(disable: 4103) +#endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_SUFFIX #endif +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif } // namespace boost diff --git a/include/boost/regex/v4/regex_grep.hpp b/include/boost/regex/v4/regex_grep.hpp index b8bb8479..3a3d906e 100644 --- a/include/boost/regex/v4/regex_grep.hpp +++ b/include/boost/regex/v4/regex_grep.hpp @@ -22,9 +22,16 @@ namespace boost{ +#ifdef BOOST_MSVC +#pragma warning(push) +#pragma warning(disable: 4103) +#endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_PREFIX #endif +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif // // regex_grep: @@ -131,9 +138,16 @@ inline unsigned int regex_grep(bool (*foo)(const match_results::const_iterator, return regex_iterator::const_iterator, charT, traits>(p.begin(), p.end(), e, m); } +#ifdef BOOST_MSVC +#pragma warning(push) +#pragma warning(disable: 4103) +#endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_SUFFIX #endif +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif } // namespace boost diff --git a/include/boost/regex/v4/regex_kmp.hpp b/include/boost/regex/v4/regex_kmp.hpp deleted file mode 100644 index 3607ef71..00000000 --- a/include/boost/regex/v4/regex_kmp.hpp +++ /dev/null @@ -1,108 +0,0 @@ -/* - * - * Copyright (c) 1998-2002 - * John Maddock - * - * Use, modification and distribution are subject to the - * Boost Software License, Version 1.0. (See accompanying file - * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - * - */ - - /* - * LOCATION: see http://www.boost.org for most recent version. - * FILE regex_kmp.hpp - * VERSION see - * DESCRIPTION: Provides Knuth Morris Pratt search operations. - * Note this is an internal header file included - * by regex.hpp, do not include on its own. - */ - -#ifndef BOOST_REGEX_KMP_HPP -#define BOOST_REGEX_KMP_HPP - -#ifdef BOOST_REGEX_CONFIG_HPP -#include -#endif - - -namespace boost{ - namespace re_detail{ - -#ifdef BOOST_HAS_ABI_HEADERS -# include BOOST_ABI_PREFIX -#endif - -template -struct kmp_info -{ - unsigned int size; - unsigned int len; - const charT* pstr; - int kmp_next[1]; -}; - -template -void kmp_free(kmp_info* pinfo, const Allocator& a) -{ - typedef typename boost::detail::rebind_allocator::type atype; - atype(a).deallocate(reinterpret_cast(pinfo), pinfo->size); -} - -template -kmp_info* kmp_compile(iterator first, iterator last, charT, Trans translate, const Allocator& a) -{ - typedef typename boost::detail::rebind_allocator::type atype; - int i, j, m; - i = 0; - m = static_cast(::boost::re_detail::distance(first, last)); - ++m; - unsigned int size = sizeof(kmp_info) + sizeof(int)*m + sizeof(charT)*m; - --m; - // - // allocate struct and fill it in: - // - kmp_info* pinfo = reinterpret_cast*>(atype(a).allocate(size)); - BOOST_REGEX_NOEH_ASSERT(pinfo) - pinfo->size = size; - pinfo->len = m; - charT* p = reinterpret_cast(reinterpret_cast(pinfo) + sizeof(kmp_info) + sizeof(int)*(m+1)); - pinfo->pstr = p; - while(first != last) - { - *p = translate(*first); - ++first; - ++p; - } - *p = 0; - // - // finally do regular kmp compile: - // - j = pinfo->kmp_next[0] = -1; - while (i < m) - { - while ((j > -1) && (pinfo->pstr[i] != pinfo->pstr[j])) - j = pinfo->kmp_next[j]; - ++i; - ++j; - if (pinfo->pstr[i] == pinfo->pstr[j]) - pinfo->kmp_next[i] = pinfo->kmp_next[j]; - else - pinfo->kmp_next[i] = j; - } - - return pinfo; -} - -#ifdef BOOST_HAS_ABI_HEADERS -# include BOOST_ABI_SUFFIX -#endif - - } // namepsace re_detail -} // namespace boost - -#endif // BOOST_REGEX_KMP_HPP - - - - diff --git a/include/boost/regex/v4/regex_match.hpp b/include/boost/regex/v4/regex_match.hpp index 7c1f88d6..e947a152 100644 --- a/include/boost/regex/v4/regex_match.hpp +++ b/include/boost/regex/v4/regex_match.hpp @@ -24,9 +24,16 @@ namespace boost{ +#ifdef BOOST_MSVC +#pragma warning(push) +#pragma warning(disable: 4103) +#endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_PREFIX #endif +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif // // proc regex_match @@ -341,9 +348,16 @@ inline bool regex_match(const std::basic_string& s, #endif +#ifdef BOOST_MSVC +#pragma warning(push) +#pragma warning(disable: 4103) +#endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_SUFFIX #endif +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif } // namespace boost diff --git a/include/boost/regex/v4/regex_merge.hpp b/include/boost/regex/v4/regex_merge.hpp index 85c66dc9..404ca775 100644 --- a/include/boost/regex/v4/regex_merge.hpp +++ b/include/boost/regex/v4/regex_merge.hpp @@ -24,9 +24,16 @@ namespace boost{ +#ifdef BOOST_MSVC +#pragma warning(push) +#pragma warning(disable: 4103) +#endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_PREFIX #endif +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif template inline OutputIterator regex_merge(OutputIterator out, @@ -68,9 +75,16 @@ inline std::basic_string regex_merge(const std::basic_string& s, return regex_replace(s, e, fmt, flags); } +#ifdef BOOST_MSVC +#pragma warning(push) +#pragma warning(disable: 4103) +#endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_SUFFIX #endif +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif } // namespace boost diff --git a/include/boost/regex/v4/regex_raw_buffer.hpp b/include/boost/regex/v4/regex_raw_buffer.hpp index 6de7664a..52d45a25 100644 --- a/include/boost/regex/v4/regex_raw_buffer.hpp +++ b/include/boost/regex/v4/regex_raw_buffer.hpp @@ -31,9 +31,16 @@ namespace boost{ namespace re_detail{ +#ifdef BOOST_MSVC +#pragma warning(push) +#pragma warning(disable: 4103) +#endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_PREFIX #endif +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif struct empty_padding{}; @@ -180,9 +187,16 @@ inline raw_storage::raw_storage(size_type n) } +#ifdef BOOST_MSVC +#pragma warning(push) +#pragma warning(disable: 4103) +#endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_SUFFIX #endif +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif } // namespace re_detail } // namespace boost diff --git a/include/boost/regex/v4/regex_replace.hpp b/include/boost/regex/v4/regex_replace.hpp index 0dabba16..c4544c05 100644 --- a/include/boost/regex/v4/regex_replace.hpp +++ b/include/boost/regex/v4/regex_replace.hpp @@ -24,9 +24,16 @@ namespace boost{ +#ifdef BOOST_MSVC +#pragma warning(push) +#pragma warning(disable: 4103) +#endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_PREFIX #endif +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif template OutputIterator regex_replace(OutputIterator out, @@ -97,9 +104,16 @@ std::basic_string regex_replace(const std::basic_string& s, return result; } +#ifdef BOOST_MSVC +#pragma warning(push) +#pragma warning(disable: 4103) +#endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_SUFFIX #endif +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif } // namespace boost diff --git a/include/boost/regex/v4/regex_search.hpp b/include/boost/regex/v4/regex_search.hpp index ee6028c2..cf5579d2 100644 --- a/include/boost/regex/v4/regex_search.hpp +++ b/include/boost/regex/v4/regex_search.hpp @@ -22,9 +22,16 @@ namespace boost{ +#ifdef BOOST_MSVC +#pragma warning(push) +#pragma warning(disable: 4103) +#endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_PREFIX #endif +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif template bool regex_search(BidiIterator first, BidiIterator last, @@ -192,9 +199,16 @@ inline bool regex_search(const std::basic_string& s, #endif // partial overload +#ifdef BOOST_MSVC +#pragma warning(push) +#pragma warning(disable: 4103) +#endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_SUFFIX #endif +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif } // namespace boost diff --git a/include/boost/regex/v4/regex_split.hpp b/include/boost/regex/v4/regex_split.hpp index 60e13e33..a7ae350f 100644 --- a/include/boost/regex/v4/regex_split.hpp +++ b/include/boost/regex/v4/regex_split.hpp @@ -23,9 +23,21 @@ namespace boost{ +#ifdef BOOST_MSVC +#pragma warning(push) +#pragma warning(disable: 4103) +#endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_PREFIX #endif +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif + +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable: 4800) +#endif namespace re_detail{ @@ -138,9 +150,20 @@ 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_MSVC +#pragma warning(push) +#pragma warning(disable: 4103) +#endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_SUFFIX #endif +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif } // namespace boost diff --git a/include/boost/regex/v4/regex_stack.hpp b/include/boost/regex/v4/regex_stack.hpp deleted file mode 100644 index 453df203..00000000 --- a/include/boost/regex/v4/regex_stack.hpp +++ /dev/null @@ -1,225 +0,0 @@ -/* - * - * Copyright (c) 1998-2002 - * John Maddock - * - * Use, modification and distribution are subject to the - * Boost Software License, Version 1.0. (See accompanying file - * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - * - */ - - /* - * LOCATION: see http://www.boost.org for most recent version. - * FILE regex_stack.hpp - * VERSION see - * DESCRIPTION: Implements customised internal regex stacks. - * Note this is an internal header file included - * by regex.hpp, do not include on its own. - */ - -#ifndef BOOST_REGEX_STACK_HPP -#define BOOST_REGEX_STACK_HPP - -#ifndef BOOST_REGEX_CONFIG_HPP -#include -#endif -#ifndef BOOST_REGEX_RAW_BUFFER_HPP -#include -#endif - -namespace boost{ - namespace re_detail{ - -#ifdef BOOST_HAS_ABI_HEADERS -# include BOOST_ABI_PREFIX -#endif - -// -// class jstack -// simplified stack optimised for push/peek/pop -// operations, we could use std::stack> instead... -// -template -class jstack -{ -public: - typedef typename boost::detail::rebind_allocator::type allocator_type; -private: - typedef typename boost::detail::rebind_allocator::type T_alloc_type; - typedef typename T_alloc_type::size_type size_type; - typedef T value_type; - struct node - { - node* next; - T* start; // first item - T* end; // last item - T* last; // end of storage - }; - - // - // empty base member optimisation: - struct data : public allocator_type - { - padding buf[(sizeof(T) * 16 + sizeof(padding) - 1) / sizeof(padding)]; - data(const Allocator& a) : allocator_type(a){} - }; - - data alloc_inst; - mutable node* m_stack; - mutable node* unused; - node base; - size_type block_size; - - void BOOST_REGEX_CALL pop_aux()const; - void BOOST_REGEX_CALL push_aux(); - -public: - jstack(size_type n = 64, const Allocator& a = Allocator()); - - ~jstack(); - - node* BOOST_REGEX_CALL get_node() - { - node* new_stack = reinterpret_cast(alloc_inst.allocate(sizeof(node) + sizeof(T) * block_size)); - BOOST_REGEX_NOEH_ASSERT(new_stack) - new_stack->last = reinterpret_cast(new_stack+1); - new_stack->start = new_stack->end = new_stack->last + block_size; - new_stack->next = 0; - return new_stack; - } - - bool BOOST_REGEX_CALL empty() - { - return (m_stack->start == m_stack->end) && (m_stack->next == 0); - } - - bool BOOST_REGEX_CALL good() - { - return (m_stack->start != m_stack->end) || (m_stack->next != 0); - } - - T& BOOST_REGEX_CALL peek() - { - if(m_stack->start == m_stack->end) - pop_aux(); - return *m_stack->end; - } - - const T& BOOST_REGEX_CALL peek()const - { - if(m_stack->start == m_stack->end) - pop_aux(); - return *m_stack->end; - } - - void BOOST_REGEX_CALL pop() - { - if(m_stack->start == m_stack->end) - pop_aux(); - ::boost::re_detail::pointer_destroy(m_stack->end); - ++(m_stack->end); - } - - void BOOST_REGEX_CALL pop(T& t) - { - if(m_stack->start == m_stack->end) - pop_aux(); - t = *m_stack->end; - ::boost::re_detail::pointer_destroy(m_stack->end); - ++(m_stack->end); - } - - void BOOST_REGEX_CALL push(const T& t) - { - if(m_stack->end == m_stack->last) - push_aux(); - --(m_stack->end); - pointer_construct(m_stack->end, t); - } - -}; - -template -jstack::jstack(size_type n, const Allocator& a) - : alloc_inst(a) -{ - unused = 0; - block_size = n; - m_stack = &base; - base.last = reinterpret_cast(alloc_inst.buf); - base.end = base.start = base.last + 16; - base.next = 0; -} - -template -void BOOST_REGEX_CALL jstack::push_aux() -{ - // make sure we have spare space on TOS: - register node* new_node; - if(unused) - { - new_node = unused; - unused = new_node->next; - new_node->next = m_stack; - m_stack = new_node; - } - else - { - new_node = get_node(); - new_node->next = m_stack; - m_stack = new_node; - } -} - -template -void BOOST_REGEX_CALL jstack::pop_aux()const -{ - // make sure that we have a valid item - // on TOS: - BOOST_ASSERT(m_stack->next); - register node* p = m_stack; - m_stack = p->next; - p->next = unused; - unused = p; -} - -template -jstack::~jstack() -{ - node* condemned; - while(good()) - pop(); - while(unused) - { - condemned = unused; - unused = unused->next; - alloc_inst.deallocate(reinterpret_cast(condemned), sizeof(node) + sizeof(T) * block_size); - } - while(m_stack != &base) - { - condemned = m_stack; - m_stack = m_stack->next; - alloc_inst.deallocate(reinterpret_cast(condemned), sizeof(node) + sizeof(T) * block_size); - } -} - -#ifdef BOOST_HAS_ABI_HEADERS -# include BOOST_ABI_SUFFIX -#endif - -} // namespace re_detail -} // namespace boost - -#endif - - - - - - - - - - - diff --git a/include/boost/regex/v4/regex_token_iterator.hpp b/include/boost/regex/v4/regex_token_iterator.hpp index a03fedd2..4e8bc36f 100644 --- a/include/boost/regex/v4/regex_token_iterator.hpp +++ b/include/boost/regex/v4/regex_token_iterator.hpp @@ -36,9 +36,16 @@ namespace boost{ +#ifdef BOOST_MSVC +#pragma warning(push) +#pragma warning(disable: 4103) +#endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_PREFIX #endif +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif #if BOOST_WORKAROUND(BOOST_MSVC, > 1300) # pragma warning(push) # pragma warning(disable:4700) @@ -312,12 +319,19 @@ inline regex_token_iterator::const_ite return regex_token_iterator::const_iterator, charT, traits>(p.begin(), p.end(), e, submatch, m); } -#if BOOST_WORKAROUND(BOOST_MSVC, == 1310) +#if BOOST_WORKAROUND(BOOST_MSVC, > 1300) # pragma warning(pop) #endif +#ifdef BOOST_MSVC +#pragma warning(push) +#pragma warning(disable: 4103) +#endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_SUFFIX #endif +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif } // namespace boost diff --git a/include/boost/regex/v4/regex_traits.hpp b/include/boost/regex/v4/regex_traits.hpp index 9f2b3700..f5f0402c 100644 --- a/include/boost/regex/v4/regex_traits.hpp +++ b/include/boost/regex/v4/regex_traits.hpp @@ -56,9 +56,16 @@ #include "boost/mpl/has_xxx.hpp" #include +#ifdef BOOST_MSVC +#pragma warning(push) +#pragma warning(disable: 4103) +#endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_PREFIX #endif +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif namespace boost{ @@ -167,9 +174,16 @@ private: } // namespace boost +#ifdef BOOST_MSVC +#pragma warning(push) +#pragma warning(disable: 4103) +#endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_SUFFIX #endif +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif #endif // include diff --git a/include/boost/regex/v4/regex_traits_defaults.hpp b/include/boost/regex/v4/regex_traits_defaults.hpp index cc1df915..38c12738 100644 --- a/include/boost/regex/v4/regex_traits_defaults.hpp +++ b/include/boost/regex/v4/regex_traits_defaults.hpp @@ -19,9 +19,16 @@ #ifndef BOOST_REGEX_TRAITS_DEFAULTS_HPP_INCLUDED #define BOOST_REGEX_TRAITS_DEFAULTS_HPP_INCLUDED +#ifdef BOOST_MSVC +#pragma warning(push) +#pragma warning(disable: 4103) +#endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_PREFIX #endif +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif #ifndef BOOST_REGEX_SYNTAX_TYPE_HPP #include @@ -77,7 +84,7 @@ inline bool is_combining(unsigned char) { return false; } -#ifndef __hpux // can't use WCHAR_MIN/MAX in pp-directives. +#ifndef __hpux // can't use WCHAR_MAX/MIN in pp-directives #ifdef _MSC_VER template<> inline bool is_combining(wchar_t c) @@ -310,8 +317,15 @@ int global_toi(const charT*& p1, const charT* p2, int radix, const traits& t) } // re_detail } // boost +#ifdef BOOST_MSVC +#pragma warning(push) +#pragma warning(disable: 4103) +#endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_SUFFIX #endif +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif #endif diff --git a/include/boost/regex/v4/regex_workaround.hpp b/include/boost/regex/v4/regex_workaround.hpp index 3659c072..917320ca 100644 --- a/include/boost/regex/v4/regex_workaround.hpp +++ b/include/boost/regex/v4/regex_workaround.hpp @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -65,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 @@ -128,7 +124,7 @@ inline void pointer_construct(T* p, const T& t) #ifdef __cplusplus namespace boost{ namespace re_detail{ -#if BOOST_WORKAROUND(BOOST_MSVC,>=1400) && defined(_CPPLIB_VER) && !(defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)) +#if BOOST_WORKAROUND(BOOST_MSVC,>=1400) && defined(_CPPLIB_VER) && defined(BOOST_DINKUMWARE_STDLIB) && !(defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)) // // MSVC 8 will either emit warnings or else refuse to compile // code that makes perfectly legitimate use of std::copy, when @@ -196,7 +192,8 @@ namespace boost{ namespace re_detail{ } }} // namespaces -#endif + +#endif // __cplusplus #endif // include guard diff --git a/include/boost/regex/v4/states.hpp b/include/boost/regex/v4/states.hpp index 551ed669..74885d2a 100644 --- a/include/boost/regex/v4/states.hpp +++ b/include/boost/regex/v4/states.hpp @@ -19,9 +19,16 @@ #ifndef BOOST_REGEX_V4_STATES_HPP #define BOOST_REGEX_V4_STATES_HPP +#ifdef BOOST_MSVC +#pragma warning(push) +#pragma warning(disable: 4103) +#endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_PREFIX #endif +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif namespace boost{ namespace re_detail{ @@ -267,9 +274,16 @@ iterator BOOST_REGEX_CALL re_is_set_member(iterator next, } // namespace boost +#ifdef BOOST_MSVC +#pragma warning(push) +#pragma warning(disable: 4103) +#endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_SUFFIX #endif +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif #endif diff --git a/include/boost/regex/v4/sub_match.hpp b/include/boost/regex/v4/sub_match.hpp index b21f4fab..1c79e39a 100644 --- a/include/boost/regex/v4/sub_match.hpp +++ b/include/boost/regex/v4/sub_match.hpp @@ -19,9 +19,16 @@ #ifndef BOOST_REGEX_V4_SUB_MATCH_HPP #define BOOST_REGEX_V4_SUB_MATCH_HPP +#ifdef BOOST_MSVC +#pragma warning(push) +#pragma warning(disable: 4103) +#endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_PREFIX #endif +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif namespace boost{ @@ -487,9 +494,16 @@ sub_match::operator unsigned int()const } // namespace boost +#ifdef BOOST_MSVC +#pragma warning(push) +#pragma warning(disable: 4103) +#endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_SUFFIX #endif +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif #endif diff --git a/include/boost/regex/v4/w32_regex_traits.hpp b/include/boost/regex/v4/w32_regex_traits.hpp index 8a85d683..2f64843d 100644 --- a/include/boost/regex/v4/w32_regex_traits.hpp +++ b/include/boost/regex/v4/w32_regex_traits.hpp @@ -35,13 +35,21 @@ #include #endif +#ifdef BOOST_MSVC +#pragma warning(push) +#pragma warning(disable: 4103) +#endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_PREFIX #endif +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif #ifdef BOOST_MSVC #pragma warning(push) #pragma warning(disable:4786) +#pragma warning(disable:4800) #endif namespace boost{ @@ -709,8 +717,15 @@ static_mutex& w32_regex_traits::get_mutex_inst() #pragma warning(pop) #endif +#ifdef BOOST_MSVC +#pragma warning(push) +#pragma warning(disable: 4103) +#endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_SUFFIX #endif +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif #endif