From 51ef8177d39fe0b4f1dc89c2d2c64ab63ef520fd Mon Sep 17 00:00:00 2001 From: John Maddock Date: Tue, 26 Aug 2003 10:49:41 +0000 Subject: [PATCH] Fixed Borland warning suppression. Changed config to use BOOST_HAS_DECLSPEC [SVN r19781] --- include/boost/regex/config.hpp | 19 +----------- include/boost/regex/config/cstring.hpp | 9 +++--- include/boost/regex/v4/fileiter.hpp | 8 +++++ .../regex/v4/perl_matcher_non_recursive.hpp | 30 +++++++++++++++---- .../boost/regex/v4/perl_matcher_recursive.hpp | 24 +++++++++++---- include/boost/regex/v4/regex_compile.hpp | 2 +- include/boost/regex/v4/sub_match.hpp | 2 +- 7 files changed, 58 insertions(+), 36 deletions(-) diff --git a/include/boost/regex/config.hpp b/include/boost/regex/config.hpp index 12a68965..49c074f5 100644 --- a/include/boost/regex/config.hpp +++ b/include/boost/regex/config.hpp @@ -195,24 +195,7 @@ using std::distance; * ****************************************************************************/ -// backwards compatibility: -#ifdef BOOST_RE_STATIC_LIB -# define BOOST_REGEX_STATIC_LINK -#endif - -#if defined(BOOST_MSVC) && defined(_DLL) -# define BOOST_REGEX_HAS_DLL_RUNTIME -#endif - -#if defined(__BORLANDC__) && defined(_RTLDLL) -# define BOOST_REGEX_HAS_DLL_RUNTIME -#endif - -#if (defined(__ICL) || defined(__COMO__)) && defined(_DLL) -# define BOOST_REGEX_HAS_DLL_RUNTIME -#endif - -#if defined(BOOST_REGEX_HAS_DLL_RUNTIME) && defined(BOOST_REGEX_DYN_LINK) && !defined(BOOST_REGEX_STATIC_LINK) +#if defined(BOOST_HAS_DECLSPEC) && defined(BOOST_REGEX_DYN_LINK) && !defined(BOOST_REGEX_STATIC_LINK) # if defined(BOOST_REGEX_SOURCE) # define BOOST_REGEX_DECL __declspec(dllexport) # define BOOST_REGEX_BUILD_DLL diff --git a/include/boost/regex/config/cstring.hpp b/include/boost/regex/config/cstring.hpp index 76809274..30d7eefb 100644 --- a/include/boost/regex/config/cstring.hpp +++ b/include/boost/regex/config/cstring.hpp @@ -266,10 +266,6 @@ inline int (toupper)(int i) using ::toupper; #endif -#ifdef __BORLANDC__ -#pragma option pop -#endif - #else #undef memcmp @@ -298,6 +294,11 @@ using ::toupper; #endif + +#ifdef __BORLANDC__ +#pragma option pop +#endif + } // namespace std #endif // __sgi diff --git a/include/boost/regex/v4/fileiter.hpp b/include/boost/regex/v4/fileiter.hpp index f9051c4a..959dfecf 100644 --- a/include/boost/regex/v4/fileiter.hpp +++ b/include/boost/regex/v4/fileiter.hpp @@ -102,6 +102,10 @@ _fi_find_handle _fi_FindFirstFile(const char* lpFileName, _fi_find_data* lpFindF bool _fi_FindNextFile(_fi_find_handle hFindFile, _fi_find_data* lpFindFileData); bool _fi_FindClose(_fi_find_handle hFindFile); +#ifdef BOOST_HAS_ABI_HEADERS +# include BOOST_ABI_SUFFIX +#endif + } // namespace re_detail } // namespace boost @@ -124,6 +128,10 @@ bool _fi_FindClose(_fi_find_handle hFindFile); namespace boost{ namespace re_detail{ +#ifdef BOOST_HAS_ABI_HEADERS +# include BOOST_ABI_PREFIX +#endif + #ifdef BOOST_REGEX_FI_WIN32_MAP // win32 mapfile class BOOST_REGEX_DECL mapfile diff --git a/include/boost/regex/v4/perl_matcher_non_recursive.hpp b/include/boost/regex/v4/perl_matcher_non_recursive.hpp index edc977c0..cd228088 100644 --- a/include/boost/regex/v4/perl_matcher_non_recursive.hpp +++ b/include/boost/regex/v4/perl_matcher_non_recursive.hpp @@ -29,9 +29,6 @@ #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_PREFIX #endif -#ifdef __BORLANDC__ -#pragma option push -w-8008 -w-8066 -w-8004 -#endif namespace boost{ namespace re_detail{ @@ -381,6 +378,9 @@ bool perl_matcher::match_rep() #ifdef BOOST_MSVC #pragma warning(push) #pragma warning(disable:4127 4244) +#endif +#ifdef __BORLANDC__ +#pragma option push -w-8008 -w-8066 -w-8004 #endif const re_repeat* rep = static_cast(pstate); @@ -464,6 +464,9 @@ bool perl_matcher::match_rep() } } return false; +#ifdef __BORLANDC__ +#pragma option pop +#endif #ifdef BOOST_MSVC #pragma warning(pop) #endif @@ -552,6 +555,9 @@ bool perl_matcher::match_char_repea #ifdef BOOST_MSVC #pragma warning(push) #pragma warning(disable:4127) +#endif +#ifdef __BORLANDC__ +#pragma option push -w-8008 -w-8066 -w-8004 #endif const re_repeat* rep = static_cast(pstate); assert(1 == static_cast(rep->next.p)->length); @@ -603,6 +609,9 @@ bool perl_matcher::match_char_repea pstate = rep->alt.p; return (position == last) ? (rep->can_be_null & mask_skip) : access::can_start(*position, rep->_map, mask_skip); } +#ifdef __BORLANDC__ +#pragma option pop +#endif #ifdef BOOST_MSVC #pragma warning(pop) #endif @@ -614,6 +623,9 @@ bool perl_matcher::match_set_repeat #ifdef BOOST_MSVC #pragma warning(push) #pragma warning(disable:4127) +#endif +#ifdef __BORLANDC__ +#pragma option push -w-8008 -w-8066 -w-8004 #endif const re_repeat* rep = static_cast(pstate); const unsigned char* map = static_cast(rep->next.p)->_map; @@ -664,6 +676,9 @@ bool perl_matcher::match_set_repeat pstate = rep->alt.p; return (position == last) ? (rep->can_be_null & mask_skip) : access::can_start(*position, rep->_map, mask_skip); } +#ifdef __BORLANDC__ +#pragma option pop +#endif #ifdef BOOST_MSVC #pragma warning(pop) #endif @@ -675,6 +690,9 @@ bool perl_matcher::match_long_set_r #ifdef BOOST_MSVC #pragma warning(push) #pragma warning(disable:4127) +#endif +#ifdef __BORLANDC__ +#pragma option push -w-8008 -w-8066 -w-8004 #endif const re_repeat* rep = static_cast(pstate); const re_set_long* set = static_cast(pstate->next.p); @@ -725,6 +743,9 @@ bool perl_matcher::match_long_set_r pstate = rep->alt.p; return (position == last) ? (rep->can_be_null & mask_skip) : access::can_start(*position, rep->_map, mask_skip); } +#ifdef __BORLANDC__ +#pragma option pop +#endif #ifdef BOOST_MSVC #pragma warning(pop) #endif @@ -1236,9 +1257,6 @@ bool perl_matcher::unwind_non_greed } // namespace re_detail } // namespace boost -#ifdef __BORLANDC__ -#pragma option pop -#endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_SUFFIX #endif diff --git a/include/boost/regex/v4/perl_matcher_recursive.hpp b/include/boost/regex/v4/perl_matcher_recursive.hpp index ff66d98d..62916fea 100644 --- a/include/boost/regex/v4/perl_matcher_recursive.hpp +++ b/include/boost/regex/v4/perl_matcher_recursive.hpp @@ -27,9 +27,6 @@ #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_PREFIX #endif -#ifdef __BORLANDC__ -#pragma option push -w-8008 -w-8066 -w-8004 -#endif namespace boost{ namespace re_detail{ @@ -415,6 +412,9 @@ bool perl_matcher::match_char_repea #ifdef BOOST_MSVC #pragma warning(push) #pragma warning(disable:4127) +#endif +#ifdef __BORLANDC__ +#pragma option push -w-8008 -w-8066 -w-8004 #endif const re_repeat* rep = static_cast(pstate); assert(1 == static_cast(rep->next.p)->length); @@ -479,6 +479,9 @@ bool perl_matcher::match_char_repea position = ++save_pos; ++count; }while(true); +#ifdef __BORLANDC__ +#pragma option pop +#endif #ifdef BOOST_MSVC #pragma warning(pop) #endif @@ -490,6 +493,9 @@ bool perl_matcher::match_set_repeat #ifdef BOOST_MSVC #pragma warning(push) #pragma warning(disable:4127) +#endif +#ifdef __BORLANDC__ +#pragma option push -w-8008 -w-8066 -w-8004 #endif const re_repeat* rep = static_cast(pstate); const unsigned char* map = static_cast(rep->next.p)->_map; @@ -553,6 +559,9 @@ bool perl_matcher::match_set_repeat position = ++save_pos; ++count; }while(true); +#ifdef __BORLANDC__ +#pragma option pop +#endif #ifdef BOOST_MSVC #pragma warning(pop) #endif @@ -564,6 +573,9 @@ bool perl_matcher::match_long_set_r #ifdef BOOST_MSVC #pragma warning(push) #pragma warning(disable:4127) +#endif +#ifdef __BORLANDC__ +#pragma option push -w-8008 -w-8066 -w-8004 #endif const re_repeat* rep = static_cast(pstate); const re_set_long* set = static_cast(pstate->next.p); @@ -627,6 +639,9 @@ bool perl_matcher::match_long_set_r position = ++save_pos; ++count; }while(true); +#ifdef __BORLANDC__ +#pragma option pop +#endif #ifdef BOOST_MSVC #pragma warning(pop) #endif @@ -686,9 +701,6 @@ bool perl_matcher::backtrack_till_m } // namespace re_detail } // namespace boost -#ifdef __BORLANDC__ -#pragma option pop -#endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_SUFFIX #endif diff --git a/include/boost/regex/v4/regex_compile.hpp b/include/boost/regex/v4/regex_compile.hpp index 0e779594..ed40ba74 100644 --- a/include/boost/regex/v4/regex_compile.hpp +++ b/include/boost/regex/v4/regex_compile.hpp @@ -1222,7 +1222,6 @@ inline return reinterpret_cast(reinterpret_cast(base) + off); } - template void BOOST_REGEX_CALL reg_expression::fixup_apply(re_detail::re_syntax_base* b, unsigned cbraces) { @@ -2184,3 +2183,4 @@ void BOOST_REGEX_CALL reg_expression::fail(unsigned in + diff --git a/include/boost/regex/v4/sub_match.hpp b/include/boost/regex/v4/sub_match.hpp index 35e2b072..f0d33850 100644 --- a/include/boost/regex/v4/sub_match.hpp +++ b/include/boost/regex/v4/sub_match.hpp @@ -39,7 +39,7 @@ struct sub_match : public std::pair typedef typename re_detail::regex_iterator_traits::difference_type difference_type; #endif typedef BidiIterator iterator_type; - + bool matched; sub_match() : std::pair(), matched(false) {}