From c24967709dd334b58b9e757ae71025a7669940b8 Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Sun, 13 Dec 2020 18:03:47 +0000 Subject: [PATCH] Reinstate many workarounds to get older msvc versions compiling. --- include/boost/regex/config.hpp | 11 +++- include/boost/regex/v5/basic_regex.hpp | 22 +++---- .../boost/regex/v5/basic_regex_creator.hpp | 27 ++++---- include/boost/regex/v5/basic_regex_parser.hpp | 60 +++++++++--------- include/boost/regex/v5/c_regex_traits.hpp | 31 +++------- include/boost/regex/v5/char_regex_traits.hpp | 8 +-- include/boost/regex/v5/cpp_regex_traits.hpp | 16 ++--- include/boost/regex/v5/cregex.hpp | 8 +-- include/boost/regex/v5/icu.hpp | 4 +- include/boost/regex/v5/iterator_traits.hpp | 8 +-- include/boost/regex/v5/match_flags.hpp | 6 +- include/boost/regex/v5/match_results.hpp | 18 +++--- include/boost/regex/v5/object_cache.hpp | 6 +- include/boost/regex/v5/pattern_except.hpp | 16 ++--- include/boost/regex/v5/perl_matcher.hpp | 32 +++++----- .../boost/regex/v5/perl_matcher_common.hpp | 33 +++++----- .../regex/v5/perl_matcher_non_recursive.hpp | 38 +++++++----- include/boost/regex/v5/primary_transform.hpp | 8 +-- include/boost/regex/v5/regbase.hpp | 8 +-- include/boost/regex/v5/regex_format.hpp | 18 +++--- include/boost/regex/v5/regex_grep.hpp | 8 +-- include/boost/regex/v5/regex_iterator.hpp | 8 +-- include/boost/regex/v5/regex_match.hpp | 8 +-- include/boost/regex/v5/regex_merge.hpp | 8 +-- include/boost/regex/v5/regex_raw_buffer.hpp | 8 +-- include/boost/regex/v5/regex_replace.hpp | 14 ++--- include/boost/regex/v5/regex_search.hpp | 8 +-- include/boost/regex/v5/regex_split.hpp | 14 ++--- .../boost/regex/v5/regex_token_iterator.hpp | 8 +-- include/boost/regex/v5/regex_traits.hpp | 8 +-- .../boost/regex/v5/regex_traits_defaults.hpp | 62 ++++++++++++++----- include/boost/regex/v5/regex_workaround.hpp | 32 +++++++++- include/boost/regex/v5/states.hpp | 8 +-- include/boost/regex/v5/sub_match.hpp | 8 +-- .../regex/v5/u32regex_token_iterator.hpp | 4 +- include/boost/regex/v5/unicode_iterator.hpp | 4 +- include/boost/regex/v5/w32_regex_traits.hpp | 14 ++--- src/static_mutex.cpp | 2 +- src/wide_posix_api.cpp | 2 +- test/Jamfile.v2 | 13 +++- test/regress/main.cpp | 15 ----- 41 files changed, 341 insertions(+), 293 deletions(-) diff --git a/include/boost/regex/config.hpp b/include/boost/regex/config.hpp index 519adf34..b67aaee4 100644 --- a/include/boost/regex/config.hpp +++ b/include/boost/regex/config.hpp @@ -98,7 +98,8 @@ *******************************************************************************/ #if defined(BOOST_NO_STD_LOCALE) || defined(BOOST_NO_CXX11_HDR_MUTEX) || defined(BOOST_NO_CXX11_HDR_TYPE_TRAITS) \ - || defined(BOOST_NO_CXX11_HDR_ATOMIC) || defined(BOOST_NO_CXX11_ALLOCATOR) || defined(BOOST_NO_CXX11_SMART_PTR) || defined(BOOST_NO_CXX11_STATIC_ASSERT) + || defined(BOOST_NO_CXX11_HDR_ATOMIC) || defined(BOOST_NO_CXX11_ALLOCATOR) || defined(BOOST_NO_CXX11_SMART_PTR) \ + || defined(BOOST_NO_CXX11_STATIC_ASSERT) || defined(BOOST_NO_NOEXCEPT) #ifndef BOOST_REGEX_CXX03 # define BOOST_REGEX_CXX03 #endif @@ -201,6 +202,14 @@ # define BOOST_REGEX_NO_W32 #endif +#ifdef BOOST_REGEX_STANDALONE +# if defined(_MSC_VER) && !defined(__clang__) && !defined(__GNUC__) +# define BOOST_REGEX_MSVC _MSC_VER +#endif +#elif defined(BOOST_MSVC) +# define BOOST_REGEX_MSVC BOOST_MSVC +#endif + /***************************************************************************** * diff --git a/include/boost/regex/v5/basic_regex.hpp b/include/boost/regex/v5/basic_regex.hpp index 00e095ee..04205f7a 100644 --- a/include/boost/regex/v5/basic_regex.hpp +++ b/include/boost/regex/v5/basic_regex.hpp @@ -19,30 +19,30 @@ #ifndef BOOST_REGEX_V5_BASIC_REGEX_HPP #define BOOST_REGEX_V5_BASIC_REGEX_HPP -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(push) #pragma warning(disable: 4103) #endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_PREFIX #endif -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(pop) #endif #include namespace boost{ -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(push) #pragma warning(disable : 4251) -#if BOOST_MSVC < 1700 +#if BOOST_REGEX_MSVC < 1700 # pragma warning(disable : 4231) #endif -#if BOOST_MSVC < 1600 +#if BOOST_REGEX_MSVC < 1600 #pragma warning(disable : 4660) #endif -#if BOOST_MSVC < 1910 +#if BOOST_REGEX_MSVC < 1910 #pragma warning(disable:4800) #endif #endif @@ -177,14 +177,14 @@ struct regex_data : public named_subexpressions ::boost::regex_traits_wrapper >& t) : m_ptraits(t), m_flags(0), m_status(0), m_expression(0), m_expression_len(0), m_mark_count(0), m_first_state(0), m_restart_type(0), -#if !defined(BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX) && !(defined(BOOST_MSVC) && (BOOST_MSVC < 1900)) +#if !defined(BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX) && !(defined(BOOST_REGEX_MSVC) && (BOOST_REGEX_MSVC < 1900)) m_startmap{ 0 }, #endif m_can_be_null(0), m_word_mask(0), m_has_recursions(false), m_disable_match_any(false) {} regex_data() : m_ptraits(new ::boost::regex_traits_wrapper()), m_flags(0), m_status(0), m_expression(0), m_expression_len(0), m_mark_count(0), m_first_state(0), m_restart_type(0), -#if !defined(BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX) && !(defined(BOOST_MSVC) && (BOOST_MSVC < 1900)) +#if !defined(BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX) && !(defined(BOOST_REGEX_MSVC) && (BOOST_REGEX_MSVC < 1900)) m_startmap{ 0 }, #endif m_can_be_null(0), m_word_mask(0), m_has_recursions(false), m_disable_match_any(false) {} @@ -786,20 +786,20 @@ public: }; -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning (pop) #endif } // namespace boost -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(push) #pragma warning(disable: 4103) #endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_SUFFIX #endif -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(pop) #endif diff --git a/include/boost/regex/v5/basic_regex_creator.hpp b/include/boost/regex/v5/basic_regex_creator.hpp index 19b72070..4bba6af0 100644 --- a/include/boost/regex/v5/basic_regex_creator.hpp +++ b/include/boost/regex/v5/basic_regex_creator.hpp @@ -22,20 +22,21 @@ #include -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(push) #pragma warning(disable: 4103) #endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_PREFIX #endif -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(pop) #endif -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC # pragma warning(push) -#if BOOST_MSVC < 1910 +#pragma warning(disable:4459) +#if BOOST_REGEX_MSVC < 1910 #pragma warning(disable:4800) #endif #endif @@ -478,10 +479,10 @@ re_syntax_base* basic_regex_creator::append_set( return 0; } charT* p = static_cast(this->m_pdata->m_data.extend(sizeof(charT) * (s1.size() + s2.size() + 2) ) ); - std::copy(s1.begin(), s1.end(), p); + BOOST_REGEX_DETAIL_NS::copy(s1.begin(), s1.end(), p); p[s1.size()] = charT(0); p += s1.size() + 1; - std::copy(s2.begin(), s2.end(), p); + BOOST_REGEX_DETAIL_NS::copy(s2.begin(), s2.end(), p); p[s2.size()] = charT(0); } // @@ -502,7 +503,7 @@ re_syntax_base* basic_regex_creator::append_set( if(s.empty()) return 0; // invalid or unsupported equivalence class charT* p = static_cast(this->m_pdata->m_data.extend(sizeof(charT) * (s.size()+1) ) ); - std::copy(s.begin(), s.end(), p); + BOOST_REGEX_DETAIL_NS::copy(s.begin(), s.end(), p); p[s.size()] = charT(0); ++sfirst; } @@ -681,7 +682,7 @@ void basic_regex_creator::finalize(const charT* p1, const charT* m_pdata->m_expression_len = len; charT* ps = static_cast(m_pdata->m_data.extend(sizeof(charT) * (1 + (p2 - p1)))); m_pdata->m_expression = ps; - std::copy(p1, p2, ps); + BOOST_REGEX_DETAIL_NS::copy(p1, p2, ps); ps[p2 - p1] = 0; // fill in our other data... // successful parsing implies a zero status: @@ -1530,7 +1531,7 @@ void basic_regex_creator::probe_leading_repeat(re_syntax_base* st state = state->next.p; continue; } -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC # pragma warning(push) #pragma warning(disable:6011) #endif @@ -1541,7 +1542,7 @@ void basic_regex_creator::probe_leading_repeat(re_syntax_base* st state = static_cast(state->next.p)->alt.p->next.p; continue; } -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC # pragma warning(pop) #endif if(static_cast(state)->index == -3) @@ -1580,18 +1581,18 @@ void basic_regex_creator::probe_leading_repeat(re_syntax_base* st } // namespace boost -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC # pragma warning(pop) #endif -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(push) #pragma warning(disable: 4103) #endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_SUFFIX #endif -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(pop) #endif diff --git a/include/boost/regex/v5/basic_regex_parser.hpp b/include/boost/regex/v5/basic_regex_parser.hpp index 4e8caf20..021c53e7 100644 --- a/include/boost/regex/v5/basic_regex_parser.hpp +++ b/include/boost/regex/v5/basic_regex_parser.hpp @@ -19,27 +19,27 @@ #ifndef BOOST_REGEX_V5_BASIC_REGEX_PARSER_HPP #define BOOST_REGEX_V5_BASIC_REGEX_PARSER_HPP -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(push) #pragma warning(disable: 4103) -#if BOOST_MSVC >= 1800 +#if BOOST_REGEX_MSVC >= 1800 #pragma warning(disable: 26812) #endif #endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_PREFIX #endif -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(pop) #endif namespace boost{ namespace BOOST_REGEX_DETAIL_NS{ -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(push) -#pragma warning(disable:4244) -#if BOOST_MSVC < 1910 +#pragma warning(disable:4244 4459) +#if BOOST_REGEX_MSVC < 1910 #pragma warning(disable:4800) #endif #endif @@ -112,7 +112,7 @@ private: std::ptrdiff_t m_alt_insert_point; // where to insert the next alternative bool m_has_case_change; // true if somewhere in the current block the case has changed unsigned m_recursion_count; // How many times we've called parse_all. -#if defined(BOOST_MSVC) && defined(_M_IX86) +#if defined(BOOST_REGEX_MSVC) && defined(_M_IX86) // This is an ugly warning suppression workaround (for warnings *inside* std::vector // that can not otherwise be suppressed)... static_assert(sizeof(long) >= sizeof(void*), "Long isn't long enough!"); @@ -267,7 +267,7 @@ bool basic_regex_parser::parse_all() return result; } -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(push) #pragma warning(disable:4702) #endif @@ -325,9 +325,9 @@ bool basic_regex_parser::parse_basic() return true; } -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC # pragma warning(push) -#if BOOST_MSVC >= 1800 +#if BOOST_REGEX_MSVC >= 1800 #pragma warning(disable:26812) #endif #endif @@ -418,10 +418,10 @@ bool basic_regex_parser::parse_extended() } return result; } -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC # pragma warning(pop) #endif -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(pop) #endif @@ -925,11 +925,11 @@ escape_type_class_jump: } if(negative) i = 1 + (static_cast(m_mark_count) - i); - if(((i < hash_value_mask) && (i > 0) && (this->m_backrefs.test(i))) || ((i >= hash_value_mask) && (this->m_pdata->get_id(i) > 0) && (this->m_backrefs.test(this->m_pdata->get_id(i))))) + if(((i < hash_value_mask) && (i > 0) && (this->m_backrefs.test((std::size_t)i))) || ((i >= hash_value_mask) && (this->m_pdata->get_id((int)i) > 0) && (this->m_backrefs.test(this->m_pdata->get_id((int)i))))) { m_position = pc; re_brace* pb = static_cast(this->append_state(syntax_element_backref, sizeof(re_brace))); - pb->index = i; + pb->index = (int)i; pb->icase = this->flags() & regbase::icase; } else @@ -1759,7 +1759,7 @@ bool valid_value(charT c, std::intmax_t v) template charT basic_regex_parser::unescape_character() { -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(push) #pragma warning(disable:4127) #endif @@ -1940,7 +1940,7 @@ charT basic_regex_parser::unescape_character() } ++m_position; return result; -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(pop) #endif } @@ -1957,11 +1957,11 @@ bool basic_regex_parser::parse_backref() charT c = unescape_character(); this->append_literal(c); } - else if((i > 0) && (this->m_backrefs.test(i))) + else if((i > 0) && (this->m_backrefs.test((std::size_t)i))) { m_position = pc; re_brace* pb = static_cast(this->append_state(syntax_element_backref, sizeof(re_brace))); - pb->index = i; + pb->index = (int)i; pb->icase = this->flags() & regbase::icase; } else @@ -1978,7 +1978,7 @@ bool basic_regex_parser::parse_backref() template bool basic_regex_parser::parse_QE() { -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(push) #pragma warning(disable:4127) #endif @@ -2022,7 +2022,7 @@ bool basic_regex_parser::parse_QE() ++start; } return true; -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(pop) #endif } @@ -2105,7 +2105,7 @@ bool basic_regex_parser::parse_perl_extension() insert_recursion: pb->index = markid = 0; re_recurse* pr = static_cast(this->append_state(syntax_element_recurse, sizeof(re_recurse))); - pr->alt.i = v; + pr->alt.i = (std::ptrdiff_t)v; pr->state_id = 0; static_cast( this->append_state(syntax_element_toggle_case, sizeof(re_case)) @@ -2260,7 +2260,7 @@ insert_recursion: v = -this->m_traits.toi(m_position, m_end, 10); } re_brace* br = static_cast(this->append_state(syntax_element_assert_backref, sizeof(re_brace))); - br->index = v < 0 ? (v - 1) : 0; + br->index = v < 0 ? (int)(v - 1) : 0; if(this->m_traits.syntax_type(*m_position) != regex_constants::syntax_close_mark) { // Rewind to start of (? sequence: @@ -2293,7 +2293,7 @@ insert_recursion: } v = static_cast(hash_value_from_capture_name(base, m_position)); re_brace* br = static_cast(this->append_state(syntax_element_assert_backref, sizeof(re_brace))); - br->index = v; + br->index = (int)v; if(((*m_position != charT('>')) && (*m_position != charT('\''))) || (++m_position == m_end)) { // Rewind to start of (? sequence: @@ -2354,7 +2354,7 @@ insert_recursion: else if(v > 0) { re_brace* br = static_cast(this->append_state(syntax_element_assert_backref, sizeof(re_brace))); - br->index = v; + br->index = (int)v; if(this->m_traits.syntax_type(*m_position) != regex_constants::syntax_close_mark) { // Rewind to start of (? sequence: @@ -2759,9 +2759,9 @@ bool basic_regex_parser::match_verb(const char* verb) return true; } -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC # pragma warning(push) -#if BOOST_MSVC >= 1800 +#if BOOST_REGEX_MSVC >= 1800 #pragma warning(disable:26812) #endif #endif @@ -2933,7 +2933,7 @@ bool basic_regex_parser::parse_perl_verb() fail(regex_constants::error_perl_extension, m_position - m_base); return false; } -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC # pragma warning(pop) #endif @@ -3143,21 +3143,21 @@ bool basic_regex_parser::unwind_alts(std::ptrdiff_t last_paren_st return true; } -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(pop) #endif } // namespace BOOST_REGEX_DETAIL_NS } // namespace boost -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(push) #pragma warning(disable: 4103) #endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_SUFFIX #endif -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(pop) #endif diff --git a/include/boost/regex/v5/c_regex_traits.hpp b/include/boost/regex/v5/c_regex_traits.hpp index 5ea679c1..ba425ed4 100644 --- a/include/boost/regex/v5/c_regex_traits.hpp +++ b/include/boost/regex/v5/c_regex_traits.hpp @@ -19,29 +19,18 @@ #ifndef BOOST_C_REGEX_TRAITS_HPP_INCLUDED #define BOOST_C_REGEX_TRAITS_HPP_INCLUDED -#ifndef BOOST_REGEX_CONFIG_HPP #include -#endif -#ifndef BOOST_REGEX_WORKAROUND_HPP #include -#endif - #include -#ifdef BOOST_NO_STDC_NAMESPACE -namespace std{ - using ::strlen; using ::tolower; -} -#endif - -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(push) #pragma warning(disable: 4103 4244) #endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_PREFIX #endif -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(pop) #endif @@ -459,14 +448,10 @@ inline bool c_regex_traits::isctype(wchar_t c, char_class_type mask) inline c_regex_traits::string_type c_regex_traits::lookup_collatename(const wchar_t* p1, const wchar_t* p2) { -#ifdef BOOST_MSVC -#pragma warning(push) -#pragma warning(disable: 4244) -#endif - std::string name(p1, p2); -#ifdef BOOST_MSVC -#pragma warning(pop) -#endif + std::string name; + // Usual msvc warning suppression does not work here with std::string template constructor.... use a workaround instead: + for (const wchar_t* pos = p1; pos != p2; ++pos) + name.push_back((char)*pos); name = ::boost::BOOST_REGEX_DETAIL_NS::lookup_default_collate_name(name); if (!name.empty()) return string_type(name.begin(), name.end()); @@ -494,14 +479,14 @@ inline int c_regex_traits::value(wchar_t c, int radix) } -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(push) #pragma warning(disable: 4103) #endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_SUFFIX #endif -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(pop) #endif diff --git a/include/boost/regex/v5/char_regex_traits.hpp b/include/boost/regex/v5/char_regex_traits.hpp index 95a35c24..cff34328 100644 --- a/include/boost/regex/v5/char_regex_traits.hpp +++ b/include/boost/regex/v5/char_regex_traits.hpp @@ -20,14 +20,14 @@ #ifndef BOOST_REGEX_V5_CHAR_REGEX_TRAITS_HPP #define BOOST_REGEX_V5_CHAR_REGEX_TRAITS_HPP -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(push) #pragma warning(disable: 4103) #endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_PREFIX #endif -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(pop) #endif @@ -66,14 +66,14 @@ public: } // namespace deprecated } // namespace boost -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(push) #pragma warning(disable: 4103) #endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_SUFFIX #endif -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(pop) #endif diff --git a/include/boost/regex/v5/cpp_regex_traits.hpp b/include/boost/regex/v5/cpp_regex_traits.hpp index 2cb4ee01..a37601a9 100644 --- a/include/boost/regex/v5/cpp_regex_traits.hpp +++ b/include/boost/regex/v5/cpp_regex_traits.hpp @@ -46,18 +46,18 @@ #include #include -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(push) #pragma warning(disable: 4103) #endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_PREFIX #endif -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(pop) #endif -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(push) #pragma warning(disable:4786 4251) #endif @@ -140,12 +140,12 @@ parser_buf::seekoff(off_type off, ::std::ios_base::seekdir way, : } default: ; } -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(push) #pragma warning(disable:4244) #endif return static_cast(this->gptr() - this->eback()); -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(pop) #endif } @@ -1070,18 +1070,18 @@ namespace BOOST_REGEX_DETAIL_NS { } // boost -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(pop) #endif -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(push) #pragma warning(disable: 4103) #endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_SUFFIX #endif -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(pop) #endif diff --git a/include/boost/regex/v5/cregex.hpp b/include/boost/regex/v5/cregex.hpp index e78b7160..71d2fea0 100644 --- a/include/boost/regex/v5/cregex.hpp +++ b/include/boost/regex/v5/cregex.hpp @@ -45,14 +45,14 @@ #include #endif -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(push) #pragma warning(disable: 4103) #endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_PREFIX #endif -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(pop) #endif @@ -197,14 +197,14 @@ BOOST_REGEX_DECL void BOOST_REGEX_CCALL regfreeW(regex_tW*); #define regex_t regex_tA #endif -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(push) #pragma warning(disable: 4103) #endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_SUFFIX #endif -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(pop) #endif diff --git a/include/boost/regex/v5/icu.hpp b/include/boost/regex/v5/icu.hpp index bc21849b..a9264965 100644 --- a/include/boost/regex/v5/icu.hpp +++ b/include/boost/regex/v5/icu.hpp @@ -27,7 +27,7 @@ #include #include -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning (push) #pragma warning (disable: 4251) #endif @@ -1392,7 +1392,7 @@ inline U_NAMESPACE_QUALIFIER UnicodeString u32regex_replace(const U_NAMESPACE_QU } // namespace boost. -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning (pop) #endif diff --git a/include/boost/regex/v5/iterator_traits.hpp b/include/boost/regex/v5/iterator_traits.hpp index 7b0704ca..1e5b485f 100644 --- a/include/boost/regex/v5/iterator_traits.hpp +++ b/include/boost/regex/v5/iterator_traits.hpp @@ -19,14 +19,14 @@ #ifndef BOOST_REGEX_V5_ITERATOR_TRAITS_HPP #define BOOST_REGEX_V5_ITERATOR_TRAITS_HPP -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(push) #pragma warning(disable: 4103) #endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_PREFIX #endif -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(pop) #endif @@ -39,14 +39,14 @@ struct regex_iterator_traits : public std::iterator_traits {}; } // namespace BOOST_REGEX_DETAIL_NS } // namespace boost -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(push) #pragma warning(disable: 4103) #endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_SUFFIX #endif -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(pop) #endif diff --git a/include/boost/regex/v5/match_flags.hpp b/include/boost/regex/v5/match_flags.hpp index 3e31c651..6ff236b0 100644 --- a/include/boost/regex/v5/match_flags.hpp +++ b/include/boost/regex/v5/match_flags.hpp @@ -28,9 +28,9 @@ namespace boost{ namespace regex_constants{ #endif -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(push) -#if BOOST_MSVC >= 1800 +#if BOOST_REGEX_MSVC >= 1800 #pragma warning(disable : 26812) #endif #endif @@ -145,7 +145,7 @@ using regex_constants::format_no_copy; using regex_constants::format_first_only; /*using regex_constants::format_is_if;*/ -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(pop) #endif diff --git a/include/boost/regex/v5/match_results.hpp b/include/boost/regex/v5/match_results.hpp index a450b704..c2e2b542 100644 --- a/include/boost/regex/v5/match_results.hpp +++ b/include/boost/regex/v5/match_results.hpp @@ -19,25 +19,25 @@ #ifndef BOOST_REGEX_V5_MATCH_RESULTS_HPP #define BOOST_REGEX_V5_MATCH_RESULTS_HPP -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(push) #pragma warning(disable: 4103) #endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_PREFIX #endif -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(pop) #endif namespace boost{ -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(push) -#pragma warning(disable : 4251) -#if BOOST_MSVC < 1700 +#pragma warning(disable : 4251 4459) +#if BOOST_REGEX_MSVC < 1700 # pragma warning(disable : 4231) #endif -# if BOOST_MSVC < 1600 +# if BOOST_REGEX_MSVC < 1600 # pragma warning(disable : 4660) # endif #endif @@ -668,19 +668,19 @@ std::basic_ostream& return (os << s.str()); } -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(pop) #endif } // namespace boost -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(push) #pragma warning(disable: 4103) #endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_SUFFIX #endif -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(pop) #endif diff --git a/include/boost/regex/v5/object_cache.hpp b/include/boost/regex/v5/object_cache.hpp index 17ff616b..6ebef9b3 100644 --- a/include/boost/regex/v5/object_cache.hpp +++ b/include/boost/regex/v5/object_cache.hpp @@ -57,7 +57,7 @@ private: friend struct data; }; -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(push) #pragma warning(disable: 4702) #endif @@ -72,7 +72,7 @@ std::shared_ptr object_cache::get(const Key& k, size_ return do_get(k, l_max_cache_size); #endif } -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(pop) #endif @@ -134,7 +134,7 @@ std::shared_ptr object_cache::do_get(const Key& k, si list_iterator last = s_data.cont.end(); while((pos != last) && (s > l_max_cache_size)) { - if(pos->first.unique()) + if(pos->first.use_count() == 1) { list_iterator condemmed(pos); ++pos; diff --git a/include/boost/regex/v5/pattern_except.hpp b/include/boost/regex/v5/pattern_except.hpp index 93c9db19..d7cc6b82 100644 --- a/include/boost/regex/v5/pattern_except.hpp +++ b/include/boost/regex/v5/pattern_except.hpp @@ -30,22 +30,22 @@ namespace boost{ -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(push) #pragma warning(disable: 4103) #endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_PREFIX #endif -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(pop) #endif -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(push) #pragma warning(disable : 4275) -#if BOOST_MSVC >= 1800 -#pragma warning(disable : 26812) +#if BOOST_REGEX_MSVC >= 1800 +#pragma warning(disable : 26812 4459) #endif #endif class regex_error : public std::runtime_error @@ -107,18 +107,18 @@ void raise_error(const traits& t, regex_constants::error_type code) } -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(pop) #endif -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(push) #pragma warning(disable: 4103) #endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_SUFFIX #endif -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(pop) #endif diff --git a/include/boost/regex/v5/perl_matcher.hpp b/include/boost/regex/v5/perl_matcher.hpp index 8bb75260..072254af 100644 --- a/include/boost/regex/v5/perl_matcher.hpp +++ b/include/boost/regex/v5/perl_matcher.hpp @@ -14,27 +14,27 @@ #include -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(push) #pragma warning(disable: 4103) #endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_PREFIX #endif -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(pop) #endif -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC # pragma warning(push) -#pragma warning(disable : 4251) -#if BOOST_MSVC < 1700 +#pragma warning(disable : 4251 4459) +#if BOOST_REGEX_MSVC < 1700 # pragma warning(disable : 4231) #endif -# if BOOST_MSVC < 1600 +# if BOOST_REGEX_MSVC < 1600 # pragma warning(disable : 4660) # endif -#if BOOST_MSVC < 1910 +#if BOOST_REGEX_MSVC < 1910 #pragma warning(disable:4800) #endif #endif @@ -332,9 +332,9 @@ enum saved_state_type saved_state_count = 14 }; -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC # pragma warning(push) -#if BOOST_MSVC >= 1800 +#if BOOST_REGEX_MSVC >= 1800 #pragma warning(disable:26495) #endif #endif @@ -349,7 +349,7 @@ struct recursion_info repeater_count* repeater_stack; iterator location_of_start; }; -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC # pragma warning(pop) #endif @@ -550,9 +550,9 @@ private: // Recursion limit: unsigned m_recursions; -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC # pragma warning(push) -#if BOOST_MSVC >= 1800 +#if BOOST_REGEX_MSVC >= 1800 #pragma warning(disable:26495) #endif #endif @@ -564,25 +564,25 @@ private: } perl_matcher(const perl_matcher& that) : m_result(that.m_result), re(that.re), traits_inst(that.traits_inst), rep_obj(0) {} -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC # pragma warning(pop) #endif }; } // namespace BOOST_REGEX_DETAIL_NS -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC # pragma warning(pop) #endif -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(push) #pragma warning(disable: 4103) #endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_SUFFIX #endif -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(pop) #endif diff --git a/include/boost/regex/v5/perl_matcher_common.hpp b/include/boost/regex/v5/perl_matcher_common.hpp index deba9d46..7b3fa490 100644 --- a/include/boost/regex/v5/perl_matcher_common.hpp +++ b/include/boost/regex/v5/perl_matcher_common.hpp @@ -20,26 +20,27 @@ #ifndef BOOST_REGEX_V5_PERL_MATCHER_COMMON_HPP #define BOOST_REGEX_V5_PERL_MATCHER_COMMON_HPP -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(push) #pragma warning(disable: 4103) -#if BOOST_MSVC >= 1800 +#if BOOST_REGEX_MSVC >= 1800 #pragma warning(disable: 26812) #endif #endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_PREFIX #endif -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(pop) #endif #ifdef BOOST_BORLANDC # pragma option push -w-8008 -w-8066 #endif -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC # pragma warning(push) -#if BOOST_MSVC < 1910 +#pragma warning(disable:4459) +#if BOOST_REGEX_MSVC < 1910 #pragma warning(disable:4800) #endif #endif @@ -47,7 +48,7 @@ namespace boost{ namespace BOOST_REGEX_DETAIL_NS{ -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC # pragma warning(push) #pragma warning(disable:26812) #endif @@ -100,7 +101,7 @@ void perl_matcher::construct_init(const basic_r if(e.get_data().m_disable_match_any) m_match_flags &= regex_constants::match_not_any; } -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC # pragma warning(pop) #endif @@ -696,7 +697,7 @@ bool perl_matcher::match_restart_continue() template bool perl_matcher::match_backstep() { -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(push) #pragma warning(disable:4127) #endif @@ -719,7 +720,7 @@ bool perl_matcher::match_backstep() } pstate = pstate->next.p; return true; -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(pop) #endif } @@ -806,7 +807,7 @@ bool perl_matcher::match_accept() template bool perl_matcher::find_restart_any() { -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(push) #pragma warning(disable:4127) #endif @@ -831,7 +832,7 @@ bool perl_matcher::find_restart_any() ++position; } return false; -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(pop) #endif } @@ -839,7 +840,7 @@ bool perl_matcher::find_restart_any() template bool perl_matcher::find_restart_word() { -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(push) #pragma warning(disable:4127) #endif @@ -867,7 +868,7 @@ bool perl_matcher::find_restart_word() break; } while(true); return false; -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(pop) #endif } @@ -923,21 +924,21 @@ bool perl_matcher::find_restart_lit() } // namespace boost -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC # pragma warning(pop) #endif #ifdef BOOST_BORLANDC # pragma option pop #endif -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(push) #pragma warning(disable: 4103) #endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_SUFFIX #endif -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(pop) #endif diff --git a/include/boost/regex/v5/perl_matcher_non_recursive.hpp b/include/boost/regex/v5/perl_matcher_non_recursive.hpp index d4417ca7..73bc5993 100644 --- a/include/boost/regex/v5/perl_matcher_non_recursive.hpp +++ b/include/boost/regex/v5/perl_matcher_non_recursive.hpp @@ -22,20 +22,20 @@ #include -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(push) #pragma warning(disable: 4103) #endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_PREFIX #endif -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(pop) #endif -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC # pragma warning(push) -# pragma warning(disable: 4706) -#if BOOST_MSVC < 1910 +# pragma warning(disable: 4706 4459) +#if BOOST_REGEX_MSVC < 1910 #pragma warning(disable:4800) #endif #endif @@ -596,7 +596,7 @@ bool perl_matcher::match_alt() template bool perl_matcher::match_rep() { -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(push) #pragma warning(disable:4127 4244) #endif @@ -694,7 +694,7 @@ bool perl_matcher::match_rep() #ifdef BOOST_BORLANDC #pragma option pop #endif -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(pop) #endif } @@ -786,7 +786,7 @@ bool perl_matcher::match_dot_repeat_fast() template bool perl_matcher::match_char_repeat() { -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(push) #pragma warning(disable:4127) #endif @@ -853,7 +853,7 @@ bool perl_matcher::match_char_repeat() #ifdef BOOST_BORLANDC #pragma option pop #endif -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(pop) #endif } @@ -861,7 +861,7 @@ bool perl_matcher::match_char_repeat() template bool perl_matcher::match_set_repeat() { -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(push) #pragma warning(disable:4127) #endif @@ -927,7 +927,7 @@ bool perl_matcher::match_set_repeat() #ifdef BOOST_BORLANDC #pragma option pop #endif -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(pop) #endif } @@ -935,7 +935,7 @@ bool perl_matcher::match_set_repeat() template bool perl_matcher::match_long_set_repeat() { -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(push) #pragma warning(disable:4127) #endif @@ -1002,7 +1002,7 @@ bool perl_matcher::match_long_set_repeat() #ifdef BOOST_BORLANDC #pragma option pop #endif -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(pop) #endif } @@ -1860,7 +1860,11 @@ bool perl_matcher::unwind_then(bool b) // Unwind everything till we hit an alternative: boost::BOOST_REGEX_DETAIL_NS::inplace_destroy(m_backup_state++); bool result = false; - while((result = unwind(b)) && !m_unwound_alt){} + result = unwind(b); + while(result && !m_unwound_alt) + { + result = unwind(b); + } // We're now pointing at the next alternative, need one more backtrack // since *all* the other alternatives must fail once we've reached a THEN clause: if(result && m_unwound_alt) @@ -1871,18 +1875,18 @@ bool perl_matcher::unwind_then(bool b) } // namespace BOOST_REGEX_DETAIL_NS } // namespace boost -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC # pragma warning(pop) #endif -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(push) #pragma warning(disable: 4103) #endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_SUFFIX #endif -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(pop) #endif diff --git a/include/boost/regex/v5/primary_transform.hpp b/include/boost/regex/v5/primary_transform.hpp index 47d172aa..d494aa98 100644 --- a/include/boost/regex/v5/primary_transform.hpp +++ b/include/boost/regex/v5/primary_transform.hpp @@ -20,14 +20,14 @@ #ifndef BOOST_REGEX_PRIMARY_TRANSFORM #define BOOST_REGEX_PRIMARY_TRANSFORM -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(push) #pragma warning(disable: 4103) #endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_PREFIX #endif -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(pop) #endif @@ -125,14 +125,14 @@ unsigned find_sort_syntax(const traits* pt, charT* delim) } // namespace BOOST_REGEX_DETAIL_NS } // namespace boost -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(push) #pragma warning(disable: 4103) #endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_SUFFIX #endif -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(pop) #endif diff --git a/include/boost/regex/v5/regbase.hpp b/include/boost/regex/v5/regbase.hpp index 11d3ffb3..724f4d88 100644 --- a/include/boost/regex/v5/regbase.hpp +++ b/include/boost/regex/v5/regbase.hpp @@ -19,14 +19,14 @@ #ifndef BOOST_REGEX_V5_REGBASE_HPP #define BOOST_REGEX_V5_REGBASE_HPP -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(push) #pragma warning(disable: 4103) #endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_PREFIX #endif -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(pop) #endif @@ -165,14 +165,14 @@ namespace regex_constants{ } // namespace boost -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(push) #pragma warning(disable: 4103) #endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_SUFFIX #endif -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(pop) #endif diff --git a/include/boost/regex/v5/regex_format.hpp b/include/boost/regex/v5/regex_format.hpp index 32a861de..c11953fa 100644 --- a/include/boost/regex/v5/regex_format.hpp +++ b/include/boost/regex/v5/regex_format.hpp @@ -26,14 +26,14 @@ namespace boost{ -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(push) #pragma warning(disable: 4103) #endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_PREFIX #endif -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(pop) #endif @@ -78,7 +78,7 @@ struct trivial_format_traits } }; -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC # pragma warning(push) #pragma warning(disable:26812) #endif @@ -145,7 +145,7 @@ private: typedef typename std::is_convertible::type tag_type; return get_named_sub_index(i, j, tag_type()); } -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC // msvc-8.0 issues a spurious warning on the call to std::advance here: #pragma warning(push) #pragma warning(disable:4244) @@ -163,7 +163,7 @@ private: } return -1; } -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(pop) #endif inline int toi(ForwardIter& i, ForwardIter j, int base, const std::integral_constant&) @@ -195,7 +195,7 @@ private: basic_regex_formatter(const basic_regex_formatter&); basic_regex_formatter& operator=(const basic_regex_formatter&); }; -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC # pragma warning(pop) #endif @@ -825,7 +825,7 @@ OutputIterator regex_format_imp(OutputIterator out, { if(flags & regex_constants::format_literal) { - return std::copy(p1, p2, out); + return BOOST_REGEX_DETAIL_NS::copy(p1, p2, out); } BOOST_REGEX_DETAIL_NS::basic_regex_formatter< @@ -1124,14 +1124,14 @@ inline std::basic_string::char_type> return m.format(fmt, flags); } -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(push) #pragma warning(disable: 4103) #endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_SUFFIX #endif -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(pop) #endif diff --git a/include/boost/regex/v5/regex_grep.hpp b/include/boost/regex/v5/regex_grep.hpp index 851ebd6f..b29ef22e 100644 --- a/include/boost/regex/v5/regex_grep.hpp +++ b/include/boost/regex/v5/regex_grep.hpp @@ -22,14 +22,14 @@ namespace boost{ -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(push) #pragma warning(disable: 4103) #endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_PREFIX #endif -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(pop) #endif @@ -103,14 +103,14 @@ inline unsigned int regex_grep(Predicate foo, const std::basic_string::const_iterator, return regex_iterator::const_iterator, charT, traits>(p.begin(), p.end(), e, m); } -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(push) #pragma warning(disable: 4103) #endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_SUFFIX #endif -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(pop) #endif diff --git a/include/boost/regex/v5/regex_match.hpp b/include/boost/regex/v5/regex_match.hpp index 3aecd946..f1078db5 100644 --- a/include/boost/regex/v5/regex_match.hpp +++ b/include/boost/regex/v5/regex_match.hpp @@ -24,14 +24,14 @@ namespace boost{ -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(push) #pragma warning(disable: 4103) #endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_PREFIX #endif -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(pop) #endif @@ -97,14 +97,14 @@ inline bool regex_match(const std::basic_string& s, } -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(push) #pragma warning(disable: 4103) #endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_SUFFIX #endif -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(pop) #endif diff --git a/include/boost/regex/v5/regex_merge.hpp b/include/boost/regex/v5/regex_merge.hpp index 1d21f19f..3bbd2ff1 100644 --- a/include/boost/regex/v5/regex_merge.hpp +++ b/include/boost/regex/v5/regex_merge.hpp @@ -24,14 +24,14 @@ namespace boost{ -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(push) #pragma warning(disable: 4103) #endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_PREFIX #endif -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(pop) #endif @@ -75,14 +75,14 @@ inline std::basic_string regex_merge(const std::basic_string& s, return regex_replace(s, e, fmt, flags); } -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(push) #pragma warning(disable: 4103) #endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_SUFFIX #endif -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(pop) #endif diff --git a/include/boost/regex/v5/regex_raw_buffer.hpp b/include/boost/regex/v5/regex_raw_buffer.hpp index f4609d63..e5e9a28a 100644 --- a/include/boost/regex/v5/regex_raw_buffer.hpp +++ b/include/boost/regex/v5/regex_raw_buffer.hpp @@ -31,14 +31,14 @@ namespace boost{ namespace BOOST_REGEX_DETAIL_NS{ -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(push) #pragma warning(disable: 4103) #endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_PREFIX #endif -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(pop) #endif @@ -218,14 +218,14 @@ inline raw_storage::raw_storage(size_type n) } -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(push) #pragma warning(disable: 4103) #endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_SUFFIX #endif -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(pop) #endif diff --git a/include/boost/regex/v5/regex_replace.hpp b/include/boost/regex/v5/regex_replace.hpp index c02cca6b..98ddc16c 100644 --- a/include/boost/regex/v5/regex_replace.hpp +++ b/include/boost/regex/v5/regex_replace.hpp @@ -24,14 +24,14 @@ namespace boost{ -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(push) #pragma warning(disable: 4103) #endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_PREFIX #endif -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(pop) #endif @@ -48,7 +48,7 @@ OutputIterator regex_replace(OutputIterator out, if(i == j) { if(!(flags & regex_constants::format_no_copy)) - out = std::copy(first, last, out); + out = BOOST_REGEX_DETAIL_NS::copy(first, last, out); } else { @@ -56,7 +56,7 @@ OutputIterator regex_replace(OutputIterator out, while(i != j) { if(!(flags & regex_constants::format_no_copy)) - out = std::copy(i->prefix().first, i->prefix().second, out); + out = BOOST_REGEX_DETAIL_NS::copy(i->prefix().first, i->prefix().second, out); out = i->format(out, fmt, flags, e); last_m = (*i)[0].second; if(flags & regex_constants::format_first_only) @@ -64,7 +64,7 @@ OutputIterator regex_replace(OutputIterator out, ++i; } if(!(flags & regex_constants::format_no_copy)) - out = std::copy(last_m, last, out); + out = BOOST_REGEX_DETAIL_NS::copy(last_m, last, out); } return out; } @@ -81,14 +81,14 @@ std::basic_string regex_replace(const std::basic_string& s, return result; } -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(push) #pragma warning(disable: 4103) #endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_SUFFIX #endif -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(pop) #endif diff --git a/include/boost/regex/v5/regex_search.hpp b/include/boost/regex/v5/regex_search.hpp index bbb90490..bf1d9294 100644 --- a/include/boost/regex/v5/regex_search.hpp +++ b/include/boost/regex/v5/regex_search.hpp @@ -22,14 +22,14 @@ namespace boost{ -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(push) #pragma warning(disable: 4103) #endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_PREFIX #endif -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(pop) #endif @@ -107,14 +107,14 @@ inline bool regex_search(const std::basic_string& s, return regex_search(s.begin(), s.end(), e, flags); } -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(push) #pragma warning(disable: 4103) #endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_SUFFIX #endif -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(pop) #endif diff --git a/include/boost/regex/v5/regex_split.hpp b/include/boost/regex/v5/regex_split.hpp index afa56598..0bec26c8 100644 --- a/include/boost/regex/v5/regex_split.hpp +++ b/include/boost/regex/v5/regex_split.hpp @@ -23,20 +23,20 @@ namespace boost{ -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(push) #pragma warning(disable: 4103) #endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_PREFIX #endif -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(pop) #endif -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC # pragma warning(push) -#if BOOST_MSVC < 1910 +#if BOOST_REGEX_MSVC < 1910 #pragma warning(disable:4800) #endif #endif @@ -152,18 +152,18 @@ inline std::size_t regex_split(OutputIterator out, return regex_split(out, s, BOOST_REGEX_DETAIL_NS::get_default_expression(charT(0)), match_default, UINT_MAX); } -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC # pragma warning(pop) #endif -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(push) #pragma warning(disable: 4103) #endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_SUFFIX #endif -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(pop) #endif diff --git a/include/boost/regex/v5/regex_token_iterator.hpp b/include/boost/regex/v5/regex_token_iterator.hpp index ff97ca7d..a21de34d 100644 --- a/include/boost/regex/v5/regex_token_iterator.hpp +++ b/include/boost/regex/v5/regex_token_iterator.hpp @@ -23,14 +23,14 @@ namespace boost{ -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(push) #pragma warning(disable: 4103) #endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_PREFIX #endif -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(pop) #pragma warning(push) #pragma warning(disable:4700) @@ -258,7 +258,7 @@ inline regex_token_iterator::const_ite return regex_token_iterator::const_iterator, charT, traits>(p.begin(), p.end(), e, submatch, m); } -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(pop) #pragma warning(push) #pragma warning(disable: 4103) @@ -266,7 +266,7 @@ inline regex_token_iterator::const_ite #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_SUFFIX #endif -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(pop) #endif diff --git a/include/boost/regex/v5/regex_traits.hpp b/include/boost/regex/v5/regex_traits.hpp index bd4cf8ee..2df94b8d 100644 --- a/include/boost/regex/v5/regex_traits.hpp +++ b/include/boost/regex/v5/regex_traits.hpp @@ -31,14 +31,14 @@ #endif #include -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(push) #pragma warning(disable: 4103) #endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_PREFIX #endif -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(pop) #endif @@ -137,14 +137,14 @@ private: } // namespace boost -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(push) #pragma warning(disable: 4103) #endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_SUFFIX #endif -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(pop) #endif diff --git a/include/boost/regex/v5/regex_traits_defaults.hpp b/include/boost/regex/v5/regex_traits_defaults.hpp index 8d829f38..38f0491e 100644 --- a/include/boost/regex/v5/regex_traits_defaults.hpp +++ b/include/boost/regex/v5/regex_traits_defaults.hpp @@ -19,14 +19,14 @@ #ifndef BOOST_REGEX_TRAITS_DEFAULTS_HPP_INCLUDED #define BOOST_REGEX_TRAITS_DEFAULTS_HPP_INCLUDED -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(push) #pragma warning(disable: 4103) #endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_PREFIX #endif -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(pop) #endif @@ -41,12 +41,6 @@ #include #include -#ifdef BOOST_NO_STDC_NAMESPACE -namespace std{ - using ::strlen; -} -#endif - namespace boost{ namespace BOOST_REGEX_DETAIL_NS{ @@ -762,7 +756,20 @@ struct character_pointer_range // calling std::equal, but there is no other algorithm available: // not even a non-standard MS one. So forward to unchecked_equal // in the MS case. +#ifdef __cpp_lib_robust_nonmodifying_seq_ops + return std::equal(p1, p2, r.p1, r.p2); +#elif defined(BOOST_REGEX_MSVC) + if (((p2 - p1) != (r.p2 - r.p1))) + return false; + const charT* with = r.p1; + const charT* pos = p1; + while (pos != p2) + if (*pos++ != *with++) return false; + return true; + +#else return ((p2 - p1) == (r.p2 - r.p1)) && std::equal(p1, p2, r.p1); +#endif } }; template @@ -938,7 +945,7 @@ std::intmax_t global_toi(const charT*& p1, const charT* p2, int radix, const tra template inline typename std::enable_if<(sizeof(charT) > 1), const charT*>::type get_escape_R_string() { -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC # pragma warning(push) # pragma warning(disable:4309 4245) #endif @@ -952,7 +959,7 @@ inline typename std::enable_if<(sizeof(charT) > 1), const charT*>::type get_esca bool b = (static_cast(c) == 0x2029u); return (b ? e1 : e2); -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC # pragma warning(pop) #endif } @@ -960,14 +967,35 @@ inline typename std::enable_if<(sizeof(charT) > 1), const charT*>::type get_esca template inline typename std::enable_if<(sizeof(charT) == 1), const charT*>::type get_escape_R_string() { -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC # pragma warning(push) -# pragma warning(disable:4309) +# pragma warning(disable:4309 4245) #endif - static const charT e2[] = { '(', '?', '-', 'x', ':', '(', '?', '>', '\x0D', '\x0A', '?', - '|', '[', '\x0A', '\x0B', '\x0C', '\x85', ']', ')', ')', '\0' }; + static const charT e2[] = { + static_cast('('), + static_cast('?'), + static_cast('-'), + static_cast('x'), + static_cast(':'), + static_cast('('), + static_cast('?'), + static_cast('>'), + static_cast('\x0D'), + static_cast('\x0A'), + static_cast('?'), + static_cast('|'), + static_cast('['), + static_cast('\x0A'), + static_cast('\x0B'), + static_cast('\x0C'), + static_cast('\x85'), + static_cast(']'), + static_cast(')'), + static_cast(')'), + static_cast('\0') + }; return e2; -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC # pragma warning(pop) #endif } @@ -975,14 +1003,14 @@ inline typename std::enable_if<(sizeof(charT) == 1), const charT*>::type get_esc } // BOOST_REGEX_DETAIL_NS } // boost -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(push) #pragma warning(disable: 4103) #endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_SUFFIX #endif -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(pop) #endif diff --git a/include/boost/regex/v5/regex_workaround.hpp b/include/boost/regex/v5/regex_workaround.hpp index af56602b..e9ca79d4 100644 --- a/include/boost/regex/v5/regex_workaround.hpp +++ b/include/boost/regex/v5/regex_workaround.hpp @@ -44,7 +44,7 @@ #ifdef __cplusplus namespace boost{ namespace BOOST_REGEX_DETAIL_NS{ -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning (push) #pragma warning (disable : 4100) #endif @@ -53,7 +53,7 @@ template inline void pointer_destroy(T* p) { p->~T(); (void)p; } -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning (pop) #endif @@ -71,13 +71,39 @@ inline void pointer_construct(T* p, const T& t) ****************************************************************************/ #if defined(BOOST_WORKAROUND) -#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) && defined(__STDC_WANT_SECURE_LIB__) && __STDC_WANT_SECURE_LIB__ +#if BOOST_WORKAROUND(BOOST_REGEX_MSVC, >= 1400) && defined(__STDC_WANT_SECURE_LIB__) && __STDC_WANT_SECURE_LIB__ #define BOOST_REGEX_HAS_STRCPY_S #endif #endif #ifdef __cplusplus namespace boost{ namespace BOOST_REGEX_DETAIL_NS{ + +#if defined(BOOST_REGEX_MSVC) && (BOOST_REGEX_MSVC < 1910) + // + // MSVC 10 will either emit warnings or else refuse to compile + // code that makes perfectly legitimate use of std::copy, when + // the OutputIterator type is a user-defined class (apparently all user + // defined iterators are "unsafe"). What's more Microsoft have removed their + // non-standard "unchecked" versions, even though they are still in the MS + // documentation!! Work around this as best we can: + // + template + inline OutputIterator copy( + InputIterator first, + InputIterator last, + OutputIterator dest + ) + { + while (first != last) + *dest++ = *first++; + return dest; + } +#else + using std::copy; +#endif + + #if defined(BOOST_REGEX_HAS_STRCPY_S) // use safe versions of strcpy etc: diff --git a/include/boost/regex/v5/states.hpp b/include/boost/regex/v5/states.hpp index f322f813..20e630e4 100644 --- a/include/boost/regex/v5/states.hpp +++ b/include/boost/regex/v5/states.hpp @@ -19,14 +19,14 @@ #ifndef BOOST_REGEX_V5_STATES_HPP #define BOOST_REGEX_V5_STATES_HPP -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(push) #pragma warning(disable: 4103) #endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_PREFIX #endif -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(pop) #endif @@ -305,14 +305,14 @@ iterator re_is_set_member(iterator next, } // namespace boost -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(push) #pragma warning(disable: 4103) #endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_SUFFIX #endif -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(pop) #endif diff --git a/include/boost/regex/v5/sub_match.hpp b/include/boost/regex/v5/sub_match.hpp index 38b74883..0b988e5c 100644 --- a/include/boost/regex/v5/sub_match.hpp +++ b/include/boost/regex/v5/sub_match.hpp @@ -19,14 +19,14 @@ #ifndef BOOST_REGEX_V5_SUB_MATCH_HPP #define BOOST_REGEX_V5_SUB_MATCH_HPP -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(push) #pragma warning(disable: 4103) #endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_PREFIX #endif -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(pop) #endif @@ -389,14 +389,14 @@ std::basic_ostream& } // namespace boost -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(push) #pragma warning(disable: 4103) #endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_SUFFIX #endif -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(pop) #endif diff --git a/include/boost/regex/v5/u32regex_token_iterator.hpp b/include/boost/regex/v5/u32regex_token_iterator.hpp index 137afa64..3c2bb3b5 100644 --- a/include/boost/regex/v5/u32regex_token_iterator.hpp +++ b/include/boost/regex/v5/u32regex_token_iterator.hpp @@ -24,7 +24,7 @@ namespace boost{ #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_PREFIX #endif -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC # pragma warning(push) # pragma warning(disable:4700) #endif @@ -302,7 +302,7 @@ inline u32regex_token_iterator make_u32regex_token_iterator(const return u32regex_token_iterator(s.getBuffer(), s.getBuffer() + s.length(), e, submatch, m); } -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC # pragma warning(pop) #endif #ifdef BOOST_HAS_ABI_HEADERS diff --git a/include/boost/regex/v5/unicode_iterator.hpp b/include/boost/regex/v5/unicode_iterator.hpp index 1a6b629c..026ccf03 100644 --- a/include/boost/regex/v5/unicode_iterator.hpp +++ b/include/boost/regex/v5/unicode_iterator.hpp @@ -114,7 +114,7 @@ inline unsigned utf8_trailing_byte_count(std::uint8_t c) return utf8_byte_count(c) - 1; } -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(push) #pragma warning(disable:4100) #endif @@ -132,7 +132,7 @@ inline void invalid_utf32_code_point(std::uint32_t val) throw e; #endif } -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(pop) #endif diff --git a/include/boost/regex/v5/w32_regex_traits.hpp b/include/boost/regex/v5/w32_regex_traits.hpp index 9a4b102a..3d082b63 100644 --- a/include/boost/regex/v5/w32_regex_traits.hpp +++ b/include/boost/regex/v5/w32_regex_traits.hpp @@ -35,21 +35,21 @@ #pragma comment(lib, "user32.lib") #endif -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(push) #pragma warning(disable: 4103) #endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_PREFIX #endif -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(pop) #endif -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(push) #pragma warning(disable:4786) -#if BOOST_MSVC < 1910 +#if BOOST_REGEX_MSVC < 1910 #pragma warning(disable:4800) #endif #endif @@ -1176,18 +1176,18 @@ namespace BOOST_REGEX_DETAIL_NS { } // boost -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(pop) #endif -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(push) #pragma warning(disable: 4103) #endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_SUFFIX #endif -#ifdef BOOST_MSVC +#ifdef BOOST_REGEX_MSVC #pragma warning(pop) #endif diff --git a/src/static_mutex.cpp b/src/static_mutex.cpp index 4fa5054a..b238b44a 100644 --- a/src/static_mutex.cpp +++ b/src/static_mutex.cpp @@ -186,4 +186,4 @@ void scoped_static_mutex_lock::unlock() } #endif // BOOST_HAS_THREADS -#endif \ No newline at end of file +#endif diff --git a/src/wide_posix_api.cpp b/src/wide_posix_api.cpp index e7ecefd1..abd68c59 100644 --- a/src/wide_posix_api.cpp +++ b/src/wide_posix_api.cpp @@ -227,7 +227,7 @@ BOOST_REGEX_DECL regsize_t BOOST_REGEX_CCALL regerrorW(int code, const regex_tW* std::size_t len = p.size(); if(len < buf_size) { - std::copy(p.c_str(), p.c_str() + p.size() + 1, buf); + BOOST_REGEX_DETAIL_NS::copy(p.c_str(), p.c_str() + p.size() + 1, buf); } return len + 1; } diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index 57fe92d6..9cef46b7 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -38,6 +38,7 @@ rule regex-test ( name : sources + : requirements * : input-files * ) R_SOURCE = basic_tests.cpp main.cpp +wmain.cpp test_alt.cpp test_anchors.cpp test_asserts.cpp @@ -149,13 +150,13 @@ test-suite regex [ check-target-builds ../build//is_legacy_03 : : ../build//boost_regex ] ] [ link concepts/concept_check.cpp : - BOOST_REGEX_STANDALONE [ check-target-builds ../build//is_legacy_03 : : ../build//boost_regex ] : standalone_concept_check + BOOST_REGEX_STANDALONE [ check-target-builds ../build//is_legacy_03 : : no ] : standalone_concept_check ] [ link concepts/icu_concept_check.cpp : BOOST_REGEX_STANDALONE [ check-target-builds ../build//is_legacy_03 : : ../build//boost_regex ] ] [ link concepts/icu_concept_check.cpp : - [ check-target-builds ../build//is_legacy_03 : : ../build//boost_regex ] : standalone_icu_concept_check + [ check-target-builds ../build//is_legacy_03 : : no ] : standalone_icu_concept_check ] [ link concepts/range_concept_check.cpp : [ check-target-builds ../build//is_legacy_03 : : ../build//boost_regex ] @@ -212,3 +213,11 @@ compile test_warnings.cpp : msvc:all msvc:on gcc:all gcc:on clang:all clang:on ; + +compile test_warnings.cpp + : msvc:all msvc:on + gcc:all gcc:on + clang:all clang:on + BOOST_REGEX_STANDALONE + [ check-target-builds ../build//is_legacy_03 : : no ] + : test_warnings_standalone ; diff --git a/test/regress/main.cpp b/test/regress/main.cpp index 87ad9ff4..8942f717 100644 --- a/test/regress/main.cpp +++ b/test/regress/main.cpp @@ -201,21 +201,6 @@ void test(const char& c, const test_invalid_regex_tag& tag) do_test(c, tag); } -#ifndef BOOST_NO_WREGEX -void test(const wchar_t& c, const test_regex_replace_tag& tag) -{ - do_test(c, tag); -} -void test(const wchar_t& c, const test_regex_search_tag& tag) -{ - do_test(c, tag); -} -void test(const wchar_t& c, const test_invalid_regex_tag& tag) -{ - do_test(c, tag); -} -#endif - #ifdef BOOST_NO_EXCEPTIONS namespace boost{