diff --git a/example/snippets/regex_grep_example_4.cpp b/example/snippets/regex_grep_example_4.cpp index 533d896e..e50383b3 100644 --- a/example/snippets/regex_grep_example_4.cpp +++ b/example/snippets/regex_grep_example_4.cpp @@ -17,7 +17,7 @@ * using a C++ Builder closure as a callback. */ -#ifdef __BORLANDC__ +#if defined(__BORLANDC__) && !defined(__clang__) #include #include @@ -140,7 +140,7 @@ int main(int argc, const char** argv) return 0; } -#else // __BORLANDC__ +#else // __BORLANDC__ && !defined(__clang__) int main() { diff --git a/example/snippets/regex_match_example.cpp b/example/snippets/regex_match_example.cpp index dd10de4d..16ba79b9 100644 --- a/example/snippets/regex_match_example.cpp +++ b/example/snippets/regex_match_example.cpp @@ -49,7 +49,7 @@ int process_ftp(const char* response, std::string* msg) return -1; } -#if defined(BOOST_MSVC) || (defined(__BORLANDC__) && (__BORLANDC__ == 0x550)) +#if defined(BOOST_MSVC) || (defined(BOOST_BORLANDC) && (BOOST_BORLANDC == 0x550)) // // problem with std::getline under MSVC6sp3 istream& getline(istream& is, std::string& s) diff --git a/example/snippets/regex_split_example_1.cpp b/example/snippets/regex_split_example_1.cpp index df2ef96b..76a3c950 100644 --- a/example/snippets/regex_split_example_1.cpp +++ b/example/snippets/regex_split_example_1.cpp @@ -30,7 +30,7 @@ unsigned tokenise(std::list& l, std::string& s) using namespace std; -#if defined(BOOST_MSVC) || (defined(__BORLANDC__) && (__BORLANDC__ == 0x550)) +#if defined(BOOST_MSVC) || (defined(BOOST_BORLANDC) && (BOOST_BORLANDC == 0x550)) // // problem with std::getline under MSVC6sp3 istream& getline(istream& is, std::string& s) diff --git a/example/snippets/regex_token_iterator_eg_1.cpp b/example/snippets/regex_token_iterator_eg_1.cpp index f1ecb44d..74fcbf1a 100644 --- a/example/snippets/regex_token_iterator_eg_1.cpp +++ b/example/snippets/regex_token_iterator_eg_1.cpp @@ -23,7 +23,7 @@ using namespace std; -#if defined(BOOST_MSVC) || (defined(__BORLANDC__) && (__BORLANDC__ == 0x550)) +#if defined(BOOST_MSVC) || (defined(BOOST_BORLANDC) && (BOOST_BORLANDC == 0x550)) // // problem with std::getline under MSVC6sp3 istream& getline(istream& is, std::string& s) diff --git a/example/timer/regex_timer.cpp b/example/timer/regex_timer.cpp index 48f41a9b..d121b70f 100644 --- a/example/timer/regex_timer.cpp +++ b/example/timer/regex_timer.cpp @@ -89,7 +89,7 @@ public: }; namespace boost{ -#if defined(BOOST_MSVC) || (defined(__BORLANDC__) && (__BORLANDC__ == 0x550)) || defined(__SGI_STL_PORT) +#if defined(BOOST_MSVC) || (defined(BOOST_BORLANDC) && (BOOST_BORLANDC == 0x550)) || defined(__SGI_STL_PORT) // // problem with std::getline under MSVC6sp3 // and C++ Builder 5.5, is this really that hard? @@ -367,16 +367,9 @@ int main(int argc, char**argv) } #if defined(_WIN32) && defined(BOOST_REGEX_USE_WIN32_LOCALE) && !defined(UNDER_CE) +#if !defined(BOOST_EMBTC) #pragma comment(lib, "user32.lib") +#else +#pragma comment(lib, "user32.a") +#endif #endif - - - - - - - - - - - diff --git a/include/boost/regex/config.hpp b/include/boost/regex/config.hpp index f01321c8..9b75d507 100644 --- a/include/boost/regex/config.hpp +++ b/include/boost/regex/config.hpp @@ -22,7 +22,7 @@ * Borland C++ Fix/error check * this has to go *before* we include any std lib headers: */ -#if defined(__BORLANDC__) +#if defined(__BORLANDC__) && !defined(__clang__) # include #endif #include @@ -279,9 +279,14 @@ #endif #if defined(__BORLANDC__) && !defined(BOOST_DISABLE_WIN32) +#if defined(__clang__) +# define BOOST_REGEX_CALL __cdecl +# define BOOST_REGEX_CCALL __cdecl +#else # define BOOST_REGEX_CALL __fastcall # define BOOST_REGEX_CCALL __stdcall #endif +#endif #ifndef BOOST_REGEX_CALL # define BOOST_REGEX_CALL @@ -378,7 +383,7 @@ if(0 == (x))\ #if !defined(BOOST_REGEX_NO_W32) && !defined(BOOST_REGEX_V3) # if(defined(_WIN32) || defined(_WIN64) || defined(_WINCE)) \ - && !defined(__GNUC__) \ + && !(defined(__GNUC__) || defined(__BORLANDC__) && defined(__clang__)) \ && !(defined(__BORLANDC__) && (__BORLANDC__ >= 0x600)) \ && !(defined(__MWERKS__) && (__MWERKS__ <= 0x3003)) # define BOOST_REGEX_HAS_MS_STACK_GUARD diff --git a/include/boost/regex/config/borland.hpp b/include/boost/regex/config/borland.hpp index 51c2126b..981113e5 100644 --- a/include/boost/regex/config/borland.hpp +++ b/include/boost/regex/config/borland.hpp @@ -17,7 +17,7 @@ */ -#if defined(__BORLANDC__) +#if defined(__BORLANDC__) && !defined(__clang__) # if (__BORLANDC__ == 0x550) || (__BORLANDC__ == 0x551) // problems with std::basic_string and dll RTL: # if defined(_RTLDLL) && defined(_RWSTD_COMPILE_INSTANTIATE) diff --git a/include/boost/regex/v4/cpp_regex_traits.hpp b/include/boost/regex/v4/cpp_regex_traits.hpp index 847f2ed7..1370b0d5 100644 --- a/include/boost/regex/v4/cpp_regex_traits.hpp +++ b/include/boost/regex/v4/cpp_regex_traits.hpp @@ -616,7 +616,7 @@ typename cpp_regex_traits_implementation::string_type // std::collate::transform returns a different string! // So as a workaround, we'll truncate the string at the first NULL // which _seems_ to work.... -#if BOOST_WORKAROUND(__BORLANDC__, < 0x580) +#if BOOST_WORKAROUND(BOOST_BORLANDC, < 0x580) result.erase(result.find(charT(0))); #else // @@ -669,7 +669,7 @@ typename cpp_regex_traits_implementation::string_type return pos->second; } #if !defined(BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS)\ - && !BOOST_WORKAROUND(__BORLANDC__, <= 0x0551) + && !BOOST_WORKAROUND(BOOST_BORLANDC, <= 0x0551) std::string name(p1, p2); #else std::string name; @@ -679,7 +679,7 @@ typename cpp_regex_traits_implementation::string_type #endif name = lookup_default_collate_name(name); #if !defined(BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS)\ - && !BOOST_WORKAROUND(__BORLANDC__, <= 0x0551) + && !BOOST_WORKAROUND(BOOST_BORLANDC, <= 0x0551) if(name.size()) return string_type(name.begin(), name.end()); #else diff --git a/include/boost/regex/v4/cregex.hpp b/include/boost/regex/v4/cregex.hpp index 67abfbee..daac7e63 100644 --- a/include/boost/regex/v4/cregex.hpp +++ b/include/boost/regex/v4/cregex.hpp @@ -231,7 +231,7 @@ struct pred4; } /* namespace BOOST_REGEX_DETAIL_NS */ -#if (defined(BOOST_MSVC) || defined(__BORLANDC__)) && !defined(BOOST_DISABLE_WIN32) +#if (defined(BOOST_MSVC) || defined(BOOST_BORLANDC)) && !defined(BOOST_DISABLE_WIN32) typedef bool (__cdecl *GrepCallback)(const RegEx& expression); typedef bool (__cdecl *GrepFileCallback)(const char* file, const RegEx& expression); typedef bool (__cdecl *FindFilesCallback)(const char* file); diff --git a/include/boost/regex/v4/fileiter.hpp b/include/boost/regex/v4/fileiter.hpp index 7c865c63..79260f26 100644 --- a/include/boost/regex/v4/fileiter.hpp +++ b/include/boost/regex/v4/fileiter.hpp @@ -270,6 +270,8 @@ public: return *this; } + #if !defined(BOOST_EMBTC) + friend inline bool operator==(const mapfile_iterator& i, const mapfile_iterator& j) { return (i.file == j.file) && (i.node == j.node) && (i.offset == j.offset); @@ -308,8 +310,64 @@ public: { return i.position() - j.position(); } + + #else + + friend bool operator==(const mapfile_iterator& i, const mapfile_iterator& j); + friend bool operator!=(const mapfile_iterator& i, const mapfile_iterator& j); + friend bool operator<(const mapfile_iterator& i, const mapfile_iterator& j); + friend bool operator>(const mapfile_iterator& i, const mapfile_iterator& j); + friend bool operator<=(const mapfile_iterator& i, const mapfile_iterator& j); + friend bool operator>=(const mapfile_iterator& i, const mapfile_iterator& j); + friend mapfile_iterator operator + (const mapfile_iterator& i, long off); + friend mapfile_iterator operator + (long off, const mapfile_iterator& i); + friend mapfile_iterator operator - (const mapfile_iterator& i, long off); + friend long operator - (const mapfile_iterator& i, const mapfile_iterator& j); + + #endif + }; +#if defined(BOOST_EMBTC) + + inline bool operator==(const mapfile_iterator& i, const mapfile_iterator& j) + { + return (i.file == j.file) && (i.node == j.node) && (i.offset == j.offset); + } + + inline bool operator!=(const mapfile_iterator& i, const mapfile_iterator& j) + { + return !(i == j); + } + + inline bool operator<(const mapfile_iterator& i, const mapfile_iterator& j) + { + return i.position() < j.position(); + } + inline bool operator>(const mapfile_iterator& i, const mapfile_iterator& j) + { + return i.position() > j.position(); + } + inline bool operator<=(const mapfile_iterator& i, const mapfile_iterator& j) + { + return i.position() <= j.position(); + } + inline bool operator>=(const mapfile_iterator& i, const mapfile_iterator& j) + { + return i.position() >= j.position(); + } + mapfile_iterator operator + (long off, const mapfile_iterator& i) + { + mapfile_iterator tmp(i); + return tmp += off; + } + inline long operator - (const mapfile_iterator& i, const mapfile_iterator& j) + { + return i.position() - j.position(); + } + +#endif + #endif // _fi_sep determines the directory separator, either '\\' or '/' @@ -351,6 +409,8 @@ public: file_iterator operator++(int); const char* operator*() { return path(); } + #if !defined(BOOST_EMBTC) + friend inline bool operator == (const file_iterator& f1, const file_iterator& f2) { return ((f1.ref->hf == _fi_invalid_handle) && (f2.ref->hf == _fi_invalid_handle)); @@ -361,8 +421,29 @@ public: return !(f1 == f2); } + #else + + friend bool operator == (const file_iterator& f1, const file_iterator& f2); + friend bool operator != (const file_iterator& f1, const file_iterator& f2); + + #endif + }; +#if defined(BOOST_EMBTC) + + inline bool operator == (const file_iterator& f1, const file_iterator& f2) + { + return ((f1.ref->hf == _fi_invalid_handle) && (f2.ref->hf == _fi_invalid_handle)); + } + + inline bool operator != (const file_iterator& f1, const file_iterator& f2) + { + return !(f1 == f2); + } + +#endif + // dwa 9/13/00 - suppress unused parameter warning inline bool operator < (const file_iterator&, const file_iterator&) { @@ -401,6 +482,8 @@ public: static const char* separator() { return _fi_sep; } + #if !defined(BOOST_EMBTC) + friend inline bool operator == (const directory_iterator& f1, const directory_iterator& f2) { return ((f1.ref->hf == _fi_invalid_handle) && (f2.ref->hf == _fi_invalid_handle)); @@ -412,8 +495,30 @@ public: return !(f1 == f2); } + #else + + friend bool operator == (const directory_iterator& f1, const directory_iterator& f2); + friend bool operator != (const directory_iterator& f1, const directory_iterator& f2); + + #endif + }; +#if defined(BOOST_EMBTC) + + inline bool operator == (const directory_iterator& f1, const directory_iterator& f2) + { + return ((f1.ref->hf == _fi_invalid_handle) && (f2.ref->hf == _fi_invalid_handle)); + } + + + inline bool operator != (const directory_iterator& f1, const directory_iterator& f2) + { + return !(f1 == f2); + } + +#endif + inline bool operator < (const directory_iterator&, const directory_iterator&) { return false; diff --git a/include/boost/regex/v4/instances.hpp b/include/boost/regex/v4/instances.hpp index 0e423437..7c18b6e8 100644 --- a/include/boost/regex/v4/instances.hpp +++ b/include/boost/regex/v4/instances.hpp @@ -41,7 +41,7 @@ namespace boost{ // what follows is compiler specific: // -#if defined(__BORLANDC__) && (__BORLANDC__ < 0x600) +#if defined(BOOST_BORLANDC) && (BOOST_BORLANDC < 0x600) #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_PREFIX diff --git a/include/boost/regex/v4/match_flags.hpp b/include/boost/regex/v4/match_flags.hpp index 1999ecf0..1f7ed255 100644 --- a/include/boost/regex/v4/match_flags.hpp +++ b/include/boost/regex/v4/match_flags.hpp @@ -89,7 +89,7 @@ typedef enum _match_flags } match_flags; -#if defined(__BORLANDC__) || (defined(_MSC_VER) && (_MSC_VER <= 1310)) +#if defined(BOOST_BORLANDC) || (defined(_MSC_VER) && (_MSC_VER <= 1310)) typedef unsigned long match_flag_type; #else typedef match_flags match_flag_type; diff --git a/include/boost/regex/v4/perl_matcher_common.hpp b/include/boost/regex/v4/perl_matcher_common.hpp index 7d6ff488..dd767968 100644 --- a/include/boost/regex/v4/perl_matcher_common.hpp +++ b/include/boost/regex/v4/perl_matcher_common.hpp @@ -34,7 +34,7 @@ #pragma warning(pop) #endif -#ifdef __BORLANDC__ +#ifdef BOOST_BORLANDC # pragma option push -w-8008 -w-8066 #endif #ifdef BOOST_MSVC @@ -1012,7 +1012,7 @@ bool perl_matcher::find_restart_lit() # pragma warning(pop) #endif -#ifdef __BORLANDC__ +#ifdef BOOST_BORLANDC # pragma option pop #endif #ifdef BOOST_MSVC diff --git a/include/boost/regex/v4/perl_matcher_non_recursive.hpp b/include/boost/regex/v4/perl_matcher_non_recursive.hpp index eb470a78..4ce93790 100644 --- a/include/boost/regex/v4/perl_matcher_non_recursive.hpp +++ b/include/boost/regex/v4/perl_matcher_non_recursive.hpp @@ -600,7 +600,7 @@ bool perl_matcher::match_rep() #pragma warning(push) #pragma warning(disable:4127 4244) #endif -#ifdef __BORLANDC__ +#ifdef BOOST_BORLANDC #pragma option push -w-8008 -w-8066 -w-8004 #endif const re_repeat* rep = static_cast(pstate); @@ -691,7 +691,7 @@ bool perl_matcher::match_rep() } } return false; -#ifdef __BORLANDC__ +#ifdef BOOST_BORLANDC #pragma option pop #endif #ifdef BOOST_MSVC @@ -790,7 +790,7 @@ bool perl_matcher::match_char_repeat() #pragma warning(push) #pragma warning(disable:4127) #endif -#ifdef __BORLANDC__ +#ifdef BOOST_BORLANDC #pragma option push -w-8008 -w-8066 -w-8004 #endif const re_repeat* rep = static_cast(pstate); @@ -850,7 +850,7 @@ bool perl_matcher::match_char_repeat() pstate = rep->alt.p; return (position == last) ? (rep->can_be_null & mask_skip) : can_start(*position, rep->_map, mask_skip); } -#ifdef __BORLANDC__ +#ifdef BOOST_BORLANDC #pragma option pop #endif #ifdef BOOST_MSVC @@ -865,7 +865,7 @@ bool perl_matcher::match_set_repeat() #pragma warning(push) #pragma warning(disable:4127) #endif -#ifdef __BORLANDC__ +#ifdef BOOST_BORLANDC #pragma option push -w-8008 -w-8066 -w-8004 #endif const re_repeat* rep = static_cast(pstate); @@ -924,7 +924,7 @@ bool perl_matcher::match_set_repeat() pstate = rep->alt.p; return (position == last) ? (rep->can_be_null & mask_skip) : can_start(*position, rep->_map, mask_skip); } -#ifdef __BORLANDC__ +#ifdef BOOST_BORLANDC #pragma option pop #endif #ifdef BOOST_MSVC @@ -939,7 +939,7 @@ bool perl_matcher::match_long_set_repeat() #pragma warning(push) #pragma warning(disable:4127) #endif -#ifdef __BORLANDC__ +#ifdef BOOST_BORLANDC #pragma option push -w-8008 -w-8066 -w-8004 #endif typedef typename traits::char_class_type m_type; @@ -999,7 +999,7 @@ bool perl_matcher::match_long_set_repeat() pstate = rep->alt.p; return (position == last) ? (rep->can_be_null & mask_skip) : can_start(*position, rep->_map, mask_skip); } -#ifdef __BORLANDC__ +#ifdef BOOST_BORLANDC #pragma option pop #endif #ifdef BOOST_MSVC diff --git a/include/boost/regex/v4/perl_matcher_recursive.hpp b/include/boost/regex/v4/perl_matcher_recursive.hpp index 6c33ba47..c33475f0 100644 --- a/include/boost/regex/v4/perl_matcher_recursive.hpp +++ b/include/boost/regex/v4/perl_matcher_recursive.hpp @@ -548,7 +548,7 @@ bool perl_matcher::match_char_repeat() #pragma warning(disable:4127) #pragma warning(disable:4267) #endif -#ifdef __BORLANDC__ +#ifdef BOOST_BORLANDC #pragma option push -w-8008 -w-8066 -w-8004 #endif const re_repeat* rep = static_cast(pstate); @@ -637,7 +637,7 @@ bool perl_matcher::match_char_repeat() return false; } }while(true); -#ifdef __BORLANDC__ +#ifdef BOOST_BORLANDC #pragma option pop #endif #ifdef BOOST_MSVC @@ -652,7 +652,7 @@ bool perl_matcher::match_set_repeat() #pragma warning(push) #pragma warning(disable:4127) #endif -#ifdef __BORLANDC__ +#ifdef BOOST_BORLANDC #pragma option push -w-8008 -w-8066 -w-8004 #endif const re_repeat* rep = static_cast(pstate); @@ -732,7 +732,7 @@ bool perl_matcher::match_set_repeat() return false; } }while(true); -#ifdef __BORLANDC__ +#ifdef BOOST_BORLANDC #pragma option pop #endif #ifdef BOOST_MSVC @@ -747,7 +747,7 @@ bool perl_matcher::match_long_set_repeat() #pragma warning(push) #pragma warning(disable:4127) #endif -#ifdef __BORLANDC__ +#ifdef BOOST_BORLANDC #pragma option push -w-8008 -w-8066 -w-8004 #endif typedef typename traits::char_class_type char_class_type; @@ -828,7 +828,7 @@ bool perl_matcher::match_long_set_repeat() return false; } }while(true); -#ifdef __BORLANDC__ +#ifdef BOOST_BORLANDC #pragma option pop #endif #ifdef BOOST_MSVC diff --git a/include/boost/regex/v4/regex_token_iterator.hpp b/include/boost/regex/v4/regex_token_iterator.hpp index ee8a0120..ab15a257 100644 --- a/include/boost/regex/v4/regex_token_iterator.hpp +++ b/include/boost/regex/v4/regex_token_iterator.hpp @@ -21,7 +21,7 @@ #include #include -#if (BOOST_WORKAROUND(__BORLANDC__, >= 0x560) && BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x570)))\ +#if (BOOST_WORKAROUND(BOOST_BORLANDC, >= 0x560) && BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x570)))\ || BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3003)) // // Borland C++ Builder 6, and Visual C++ 6, @@ -71,7 +71,7 @@ public: regex_token_iterator_implementation(const regex_type* p, BidirectionalIterator last, const std::vector& v, match_flag_type f) : end(last), re(*p), flags(f), N(0), subs(v){} #if !BOOST_WORKAROUND(__HP_aCC, < 60700) -#if (BOOST_WORKAROUND(__BORLANDC__, >= 0x560) && BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x570)))\ +#if (BOOST_WORKAROUND(BOOST_BORLANDC, >= 0x560) && BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x570)))\ || BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3003)) \ || BOOST_WORKAROUND(__HP_aCC, < 60700) template @@ -196,7 +196,7 @@ public: pdata.reset(); } #if !BOOST_WORKAROUND(__HP_aCC, < 60700) -#if (BOOST_WORKAROUND(__BORLANDC__, >= 0x560) && BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x570)))\ +#if (BOOST_WORKAROUND(BOOST_BORLANDC, >= 0x560) && BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x570)))\ || BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3003)) \ || BOOST_WORKAROUND(__HP_aCC, < 60700) template diff --git a/include/boost/regex/v4/regex_traits.hpp b/include/boost/regex/v4/regex_traits.hpp index 5d427706..ffa2bb68 100644 --- a/include/boost/regex/v4/regex_traits.hpp +++ b/include/boost/regex/v4/regex_traits.hpp @@ -39,7 +39,7 @@ # include # endif #endif -#if !BOOST_WORKAROUND(__BORLANDC__, < 0x560) +#if !BOOST_WORKAROUND(BOOST_BORLANDC, < 0x560) # ifndef BOOST_C_REGEX_TRAITS_HPP_INCLUDED # include # endif diff --git a/include/boost/regex/v4/sub_match.hpp b/include/boost/regex/v4/sub_match.hpp index ff8a8e46..30a580d5 100644 --- a/include/boost/regex/v4/sub_match.hpp +++ b/include/boost/regex/v4/sub_match.hpp @@ -50,7 +50,7 @@ struct sub_match : public std::pair sub_match() : std::pair(), matched(false) {} sub_match(BidiIterator i) : std::pair(i, i), matched(false) {} #if !defined(BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS)\ - && !BOOST_WORKAROUND(__BORLANDC__, <= 0x0551)\ + && !BOOST_WORKAROUND(BOOST_BORLANDC, <= 0x0551)\ && !BOOST_WORKAROUND(__DECCXX_VER, BOOST_TESTED_AT(60590042)) template operator std::basic_string ()const diff --git a/include/boost/regex/v4/u32regex_token_iterator.hpp b/include/boost/regex/v4/u32regex_token_iterator.hpp index 952f7c41..2e04810d 100644 --- a/include/boost/regex/v4/u32regex_token_iterator.hpp +++ b/include/boost/regex/v4/u32regex_token_iterator.hpp @@ -19,7 +19,7 @@ #ifndef BOOST_REGEX_V4_U32REGEX_TOKEN_ITERATOR_HPP #define BOOST_REGEX_V4_U32REGEX_TOKEN_ITERATOR_HPP -#if (BOOST_WORKAROUND(__BORLANDC__, >= 0x560) && BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x570)))\ +#if (BOOST_WORKAROUND(BOOST_BORLANDC, >= 0x560) && BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x570)))\ || BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3003)) // // Borland C++ Builder 6, and Visual C++ 6, diff --git a/include/boost/regex/v4/w32_regex_traits.hpp b/include/boost/regex/v4/w32_regex_traits.hpp index f869e58a..1f38bf36 100644 --- a/include/boost/regex/v4/w32_regex_traits.hpp +++ b/include/boost/regex/v4/w32_regex_traits.hpp @@ -403,7 +403,7 @@ typename w32_regex_traits_implementation::string_type return pos->second; } #if !defined(BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS)\ - && !BOOST_WORKAROUND(__BORLANDC__, <= 0x0551) + && !BOOST_WORKAROUND(BOOST_BORLANDC, <= 0x0551) std::string name(p1, p2); #else std::string name; @@ -413,7 +413,7 @@ typename w32_regex_traits_implementation::string_type #endif name = lookup_default_collate_name(name); #if !defined(BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS)\ - && !BOOST_WORKAROUND(__BORLANDC__, <= 0x0551) + && !BOOST_WORKAROUND(BOOST_BORLANDC, <= 0x0551) if(name.size()) return string_type(name.begin(), name.end()); #else diff --git a/src/c_regex_traits.cpp b/src/c_regex_traits.cpp index 09300666..dd356561 100644 --- a/src/c_regex_traits.cpp +++ b/src/c_regex_traits.cpp @@ -23,7 +23,7 @@ #include #include "internals.hpp" -#if !BOOST_WORKAROUND(__BORLANDC__, < 0x560) +#if !BOOST_WORKAROUND(BOOST_BORLANDC, < 0x560) #include #include diff --git a/src/cregex.cpp b/src/cregex.cpp index ece28204..118c590a 100644 --- a/src/cregex.cpp +++ b/src/cregex.cpp @@ -37,8 +37,8 @@ typedef boost::match_flag_type match_flag_type; namespace boost{ -#ifdef __BORLANDC__ -#if __BORLANDC__ < 0x530 +#ifdef BOOST_BORLANDC +#if BOOST_BORLANDC < 0x530 // // we need to instantiate the vector classes we use // since declaring a reference to type doesn't seem to @@ -590,7 +590,7 @@ const std::size_t RegEx::npos = ~static_cast(0); } // namespace boost -#if defined(__BORLANDC__) && (__BORLANDC__ >= 0x550) && (__BORLANDC__ <= 0x551) && !defined(_RWSTD_COMPILE_INSTANTIATE) +#if defined(BOOST_BORLANDC) && (BOOST_BORLANDC >= 0x550) && (BOOST_BORLANDC <= 0x551) && !defined(_RWSTD_COMPILE_INSTANTIATE) // // this is an ugly hack to work around an ugly problem: // by default this file will produce unresolved externals during diff --git a/src/fileiter.cpp b/src/fileiter.cpp index a7a759a6..0c027ec1 100644 --- a/src/fileiter.cpp +++ b/src/fileiter.cpp @@ -61,7 +61,7 @@ namespace boost{ namespace BOOST_REGEX_DETAIL_NS{ // start with the operating system specific stuff: -#if (defined(__BORLANDC__) || defined(BOOST_REGEX_FI_WIN32_DIR) || defined(BOOST_MSVC)) && !defined(BOOST_RE_NO_WIN32) +#if (defined(BOOST_BORLANDC) || defined(BOOST_REGEX_FI_WIN32_DIR) || defined(BOOST_MSVC)) && !defined(BOOST_RE_NO_WIN32) // platform is DOS or Windows // directories are separated with '\\' diff --git a/src/instances.cpp b/src/instances.cpp index 69d72ad6..88502b19 100644 --- a/src/instances.cpp +++ b/src/instances.cpp @@ -23,7 +23,7 @@ #if !defined(BOOST_REGEX_NO_EXTERNAL_TEMPLATES) #define BOOST_REGEX_NARROW_INSTANTIATE -#ifdef __BORLANDC__ +#ifdef BOOST_BORLANDC #pragma hrdstop #endif diff --git a/src/wc_regex_traits.cpp b/src/wc_regex_traits.cpp index e7fcfb8e..aa5b028a 100644 --- a/src/wc_regex_traits.cpp +++ b/src/wc_regex_traits.cpp @@ -71,7 +71,7 @@ template BOOST_REGEX_STDLIB_DECL bool __cdecl operator>( #include #include -#if !BOOST_WORKAROUND(__BORLANDC__, < 0x560) +#if !BOOST_WORKAROUND(BOOST_BORLANDC, < 0x560) #include #ifndef BOOST_NO_WREGEX @@ -224,7 +224,7 @@ c_regex_traits::string_type BOOST_REGEX_CALL c_regex_traits::l { #if !defined(BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS)\ && !BOOST_WORKAROUND(BOOST_MSVC, < 1300)\ - && !BOOST_WORKAROUND(__BORLANDC__, <= 0x0551) + && !BOOST_WORKAROUND(BOOST_BORLANDC, <= 0x0551) std::string name(p1, p2); #else std::string name; @@ -235,7 +235,7 @@ c_regex_traits::string_type BOOST_REGEX_CALL c_regex_traits::l name = ::boost::BOOST_REGEX_DETAIL_NS::lookup_default_collate_name(name); #if !defined(BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS)\ && !BOOST_WORKAROUND(BOOST_MSVC, < 1300)\ - && !BOOST_WORKAROUND(__BORLANDC__, <= 0x0551) + && !BOOST_WORKAROUND(BOOST_BORLANDC, <= 0x0551) if(name.size()) return string_type(name.begin(), name.end()); #else @@ -257,7 +257,7 @@ c_regex_traits::string_type BOOST_REGEX_CALL c_regex_traits::l int BOOST_REGEX_CALL c_regex_traits::value(wchar_t c, int radix) { -#ifdef __BORLANDC__ +#ifdef BOOST_BORLANDC // workaround for broken wcstol: if((std::iswxdigit)(c) == 0) return -1; @@ -310,5 +310,5 @@ int BOOST_REGEX_CALL c_regex_traits::value(unsigned short c, int #endif // BOOST_NO_WREGEX -#endif // __BORLANDC__ +#endif // BOOST_BORLANDC diff --git a/src/winstances.cpp b/src/winstances.cpp index 1e0b8596..beaf0ea5 100644 --- a/src/winstances.cpp +++ b/src/winstances.cpp @@ -23,7 +23,7 @@ #if !defined(BOOST_NO_WREGEX) && !defined(BOOST_REGEX_NO_EXTERNAL_TEMPLATES) #define BOOST_REGEX_WIDE_INSTANTIATE -#ifdef __BORLANDC__ +#ifdef BOOST_BORLANDC #pragma hrdstop #endif diff --git a/test/captures/captures_test.cpp b/test/captures/captures_test.cpp index 641d1b9b..56aec674 100644 --- a/test/captures/captures_test.cpp +++ b/test/captures/captures_test.cpp @@ -68,6 +68,8 @@ void test_captures(const std::string& regx, const std::string& text, T& expected } } } + +#if !defined(BOOST_NO_WREGEX) std::wstring wre(regx.begin(), regx.end()); std::wstring wtext(text.begin(), text.end()); @@ -89,6 +91,8 @@ void test_captures(const std::string& regx, const std::string& text, T& expected } } } + +#endif #ifdef BOOST_HAS_ICU boost::u32regex ure = boost::make_u32regex(regx); diff --git a/test/collate_info/collate_info.cpp b/test/collate_info/collate_info.cpp index da96745c..be014298 100644 --- a/test/collate_info/collate_info.cpp +++ b/test/collate_info/collate_info.cpp @@ -230,7 +230,7 @@ int cpp_main(int /*argc*/, char * /*argv*/[]) print_cpp_info(wchar_t(0), "wchar_t"); #endif -#if !BOOST_WORKAROUND(__BORLANDC__, < 0x560) +#if !BOOST_WORKAROUND(BOOST_BORLANDC, < 0x560) boost::c_regex_traits a; print_sort_syntax(a, "boost::c_regex_traits"); #ifndef BOOST_NO_WREGEX diff --git a/test/concepts/concept_check.cpp b/test/concepts/concept_check.cpp index 21448f21..ed06feff 100644 --- a/test/concepts/concept_check.cpp +++ b/test/concepts/concept_check.cpp @@ -15,7 +15,7 @@ // this lets us compile at warning level 4 without seeing concept-check related warnings # pragma warning(disable:4100) #endif -#ifdef __BORLANDC__ +#ifdef BOOST_BORLANDC #pragma option -w-8019 -w-8004 -w-8008 #endif #ifdef BOOST_INTEL @@ -53,7 +53,7 @@ int main() >(); #endif #endif -#if !BOOST_WORKAROUND(__BORLANDC__, < 0x560) +#if !BOOST_WORKAROUND(BOOST_BORLANDC, < 0x560) boost::function_requires< boost::BoostRegexConcept< boost::basic_regex > diff --git a/test/concepts/icu_concept_check.cpp b/test/concepts/icu_concept_check.cpp index a55bb387..a2fe627a 100644 --- a/test/concepts/icu_concept_check.cpp +++ b/test/concepts/icu_concept_check.cpp @@ -21,7 +21,7 @@ // this lets us compile at warning level 4 without seeing concept-check related warnings # pragma warning(disable:4100) #endif -#ifdef __BORLANDC__ +#ifdef BOOST_BORLANDC #pragma option -w-8019 -w-8004 -w-8008 #endif diff --git a/test/named_subexpressions/named_subexpressions_test.cpp b/test/named_subexpressions/named_subexpressions_test.cpp index a92c02b8..5bd38fbc 100644 --- a/test/named_subexpressions/named_subexpressions_test.cpp +++ b/test/named_subexpressions/named_subexpressions_test.cpp @@ -106,7 +106,9 @@ void test_named_subexpressions(charT) int cpp_main( int , char* [] ) { test_named_subexpressions(char(0)); +#if !defined(BOOST_NO_WREGEX) test_named_subexpressions(wchar_t(0)); +#endif return 0; } diff --git a/test/regress/basic_tests.cpp b/test/regress/basic_tests.cpp index 25f00c24..a1a3e817 100644 --- a/test/regress/basic_tests.cpp +++ b/test/regress/basic_tests.cpp @@ -18,7 +18,7 @@ #include -#if BOOST_WORKAROUND(__BORLANDC__, < 0x560) +#if BOOST_WORKAROUND(BOOST_BORLANDC, < 0x560) // we get unresolved externals from basic_string // unless we do this, a well known Borland bug: #define _RWSTD_COMPILE_INSTANTIATE diff --git a/test/regress/test.hpp b/test/regress/test.hpp index e350990b..e9a1b862 100644 --- a/test/regress/test.hpp +++ b/test/regress/test.hpp @@ -103,7 +103,7 @@ void do_test(const charT& c, const tagT& tag) if(test_locale::cpp_locale_state() != test_locale::no_test) test(e1, tag); #endif -#if !BOOST_WORKAROUND(__BORLANDC__, < 0x560) +#if !BOOST_WORKAROUND(BOOST_BORLANDC, < 0x560) #if BOOST_WORKAROUND(BOOST_MSVC, <= 1200) && defined(TEST_THREADS) // typeid appears to fail in multithreaded environments: test_info::set_typename(""); diff --git a/test/regress/test_anchors.cpp b/test/regress/test_anchors.cpp index b2aabdfd..e695f920 100644 --- a/test/regress/test_anchors.cpp +++ b/test/regress/test_anchors.cpp @@ -59,7 +59,7 @@ void test_anchors() // TEST_REGEX_SEARCH("^.", boost::regex::extended, " \n \r\n ", match_default, make_array(0, 1, -2, 3, 4, -2, 7, 8, -2, -2)); TEST_REGEX_SEARCH(".$", boost::regex::extended, " \n \r\n ", match_default, make_array(1, 2, -2, 4, 5, -2, 8, 9, -2, -2)); -#if !BOOST_WORKAROUND(__BORLANDC__, < 0x560) +#if !BOOST_WORKAROUND(BOOST_BORLANDC, < 0x560) TEST_REGEX_SEARCH_W(L"^.", boost::regex::extended, L"\x2028 \x2028", match_default, make_array(0, 1, -2, 1, 2, -2, -2)); TEST_REGEX_SEARCH_W(L".$", boost::regex::extended, L" \x2028 \x2028", match_default, make_array(0, 1, -2, 2, 3, -2, 3, 4, -2, -2)); #endif diff --git a/test/regress/test_escapes.cpp b/test/regress/test_escapes.cpp index c9bc951b..74212677 100644 --- a/test/regress/test_escapes.cpp +++ b/test/regress/test_escapes.cpp @@ -61,7 +61,7 @@ void test_character_escapes() TEST_REGEX_SEARCH("a\\Q+*?\\\\Eb", perl, "a+*?\\b", match_default, make_array(0, 6, -2, -2)); TEST_REGEX_SEARCH("\\C+", perl, "abcde", match_default, make_array(0, 5, -2, -2)); TEST_REGEX_SEARCH("\\X+", perl, "abcde", match_default, make_array(0, 5, -2, -2)); -#if !BOOST_WORKAROUND(__BORLANDC__, < 0x560) +#if !BOOST_WORKAROUND(BOOST_BORLANDC, < 0x560) TEST_REGEX_SEARCH_W(L"\\X", perl, L"a\x0300\x0301", match_default, make_array(0, 3, -2, -2)); #endif // unknown escape sequences match themselves: diff --git a/test/regress/test_locale.cpp b/test/regress/test_locale.cpp index 54cd56ab..36ab7443 100644 --- a/test/regress/test_locale.cpp +++ b/test/regress/test_locale.cpp @@ -188,7 +188,7 @@ void test_en_locale(const char* name, boost::uint32_t lcid) TEST_REGEX_SEARCH_L("[[:graph:]]+", perl, "\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe", match_default, make_array(0, 93, -2, -2)); TEST_REGEX_SEARCH_L("[[:word:]]+", perl, "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf8\xf9\xfa\xfb\xfc\xfd\xfe", match_default, make_array(0, 61, -2, -2)); // collation sensitive ranges: -#if !BOOST_WORKAROUND(__BORLANDC__, < 0x600) +#if !BOOST_WORKAROUND(BOOST_BORLANDC, < 0x600) // these tests are disabled for Borland C++: a bug in std::collate // causes these tests to crash (pointer overrun in std::collate::do_transform). TEST_REGEX_SEARCH_L("[a-z]+", perl|::boost::regex_constants::collate, "\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf8\xf9\xfa\xfb\xfc", match_default, make_array(0, 28, -2, -2)); diff --git a/test/regress/test_tricky_cases.cpp b/test/regress/test_tricky_cases.cpp index f9cc25d1..7ca90921 100644 --- a/test/regress/test_tricky_cases.cpp +++ b/test/regress/test_tricky_cases.cpp @@ -276,7 +276,7 @@ void test_tricky_cases3() // posix only: TEST_REGEX_SEARCH("^[[:blank:]]*#([^\\n]*\\\\[[:space:]]+)*[^\\n]*", awk, "#define some_symbol(x) \\ \r\n foo();\\\r\n printf(#x);", match_default, make_array(0, 53, 28, 42, -2, -2)); // now try and test some unicode specific characters: -#if !BOOST_WORKAROUND(__BORLANDC__, < 0x560) +#if !BOOST_WORKAROUND(BOOST_BORLANDC, < 0x560) TEST_REGEX_SEARCH_W(L"[[:unicode:]]+", perl, L"a\x0300\x0400z", match_default, make_array(1, 3, -2, -2)); TEST_REGEX_SEARCH_W(L"[\x10-\xff]", perl, L"\x0300\x0400", match_default, make_array(-2, -2)); TEST_REGEX_SEARCH_W(L"[\01-\05]{5}", perl, L"\x0300\x0400\x0300\x0400\x0300\x0400", match_default, make_array(-2, -2));