From d66b17371068faab174c806ae289e16cfbd2659c Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Tue, 24 Sep 2024 18:08:14 +0300 Subject: [PATCH] Remove BOOST_BORLANDC workarounds --- extras/src/sp_debug_hooks.cpp | 16 -------------- include/boost/smart_ptr/bad_weak_ptr.hpp | 22 ------------------- .../boost/smart_ptr/detail/sp_convertible.hpp | 4 ---- .../boost/smart_ptr/make_shared_object.hpp | 4 ---- include/boost/smart_ptr/shared_ptr.hpp | 16 -------------- test/smart_ptr_test.cpp | 4 ---- 6 files changed, 66 deletions(-) diff --git a/extras/src/sp_debug_hooks.cpp b/extras/src/sp_debug_hooks.cpp index 7484139..bfea934 100644 --- a/extras/src/sp_debug_hooks.cpp +++ b/extras/src/sp_debug_hooks.cpp @@ -73,15 +73,11 @@ void * operator new(size_t n) throw(bad_alloc) return p; } -#if !defined(BOOST_BORLANDC) || (BOOST_BORLANDC > 0x551) - void * operator new(size_t n, nothrow_t const &) throw() { return allocate(n, allocated_scalar); } -#endif - void * operator new[](size_t n) throw(bad_alloc) { void * p = allocate(n, allocated_array); @@ -95,15 +91,11 @@ void * operator new[](size_t n) throw(bad_alloc) return p; } -#if !defined(BOOST_BORLANDC) || (BOOST_BORLANDC > 0x551) - void * operator new[](size_t n, nothrow_t const &) throw() { return allocate(n, allocated_array); } -#endif - // debug hooks namespace boost @@ -205,15 +197,11 @@ void operator delete(void * p) throw() free(pm); } -#if !defined(BOOST_BORLANDC) || (BOOST_BORLANDC > 0x551) - void operator delete(void * p, nothrow_t const &) throw() { ::operator delete(p); } -#endif - void operator delete[](void * p) throw() { if(p == 0) return; @@ -231,13 +219,9 @@ void operator delete[](void * p) throw() free(pm); } -#if !defined(BOOST_BORLANDC) || (BOOST_BORLANDC > 0x551) - void operator delete[](void * p, nothrow_t const &) throw() { ::operator delete[](p); } -#endif - #endif // defined(BOOST_SP_ENABLE_DEBUG_HOOKS) diff --git a/include/boost/smart_ptr/bad_weak_ptr.hpp b/include/boost/smart_ptr/bad_weak_ptr.hpp index d8edd04..eb618f0 100644 --- a/include/boost/smart_ptr/bad_weak_ptr.hpp +++ b/include/boost/smart_ptr/bad_weak_ptr.hpp @@ -20,23 +20,9 @@ #include #include -#ifdef BOOST_BORLANDC -# pragma warn -8026 // Functions with excep. spec. are not expanded inline -#endif - namespace boost { -// The standard library that comes with Borland C++ 5.5.1, 5.6.4 -// defines std::exception and its members as having C calling -// convention (-pc). When the definition of bad_weak_ptr -// is compiled with -ps, the compiler issues an error. -// Hence, the temporary #pragma option -pc below. - -#if defined(BOOST_BORLANDC) && BOOST_BORLANDC <= 0x564 -# pragma option push -pc -#endif - #if defined(BOOST_CLANG) // Intel C++ on Mac defines __clang__ but doesn't support the pragma # pragma clang diagnostic push @@ -57,14 +43,6 @@ public: # pragma clang diagnostic pop #endif -#if defined(BOOST_BORLANDC) && BOOST_BORLANDC <= 0x564 -# pragma option pop -#endif - } // namespace boost -#ifdef BOOST_BORLANDC -# pragma warn .8026 // Functions with excep. spec. are not expanded inline -#endif - #endif // #ifndef BOOST_SMART_PTR_BAD_WEAK_PTR_HPP_INCLUDED diff --git a/include/boost/smart_ptr/detail/sp_convertible.hpp b/include/boost/smart_ptr/detail/sp_convertible.hpp index af42288..eff46d2 100644 --- a/include/boost/smart_ptr/detail/sp_convertible.hpp +++ b/include/boost/smart_ptr/detail/sp_convertible.hpp @@ -26,10 +26,6 @@ # define BOOST_SP_NO_SP_CONVERTIBLE #endif -#if !defined( BOOST_SP_NO_SP_CONVERTIBLE ) && defined( BOOST_BORLANDC ) && ( BOOST_BORLANDC < 0x630 ) -# define BOOST_SP_NO_SP_CONVERTIBLE -#endif - #if !defined( BOOST_SP_NO_SP_CONVERTIBLE ) namespace boost diff --git a/include/boost/smart_ptr/make_shared_object.hpp b/include/boost/smart_ptr/make_shared_object.hpp index d726ec3..42b50e3 100644 --- a/include/boost/smart_ptr/make_shared_object.hpp +++ b/include/boost/smart_ptr/make_shared_object.hpp @@ -187,16 +187,12 @@ template< class T > struct sp_if_not_array< T[] > { }; -#if !defined( BOOST_BORLANDC ) || !BOOST_WORKAROUND( BOOST_BORLANDC, < 0x600 ) - template< class T, std::size_t N > struct sp_if_not_array< T[N] > { }; #endif -#endif - } // namespace detail #if !defined( BOOST_NO_FUNCTION_TEMPLATE_ORDERING ) diff --git a/include/boost/smart_ptr/shared_ptr.hpp b/include/boost/smart_ptr/shared_ptr.hpp index 20915da..854078f 100644 --- a/include/boost/smart_ptr/shared_ptr.hpp +++ b/include/boost/smart_ptr/shared_ptr.hpp @@ -80,15 +80,11 @@ template< class T > struct sp_element< T[] > typedef T type; }; -#if !defined( BOOST_BORLANDC ) || !BOOST_WORKAROUND( BOOST_BORLANDC, < 0x600 ) - template< class T, std::size_t N > struct sp_element< T[N] > { typedef T type; }; -#endif - #endif // !defined( BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION ) // sp_dereference, return type of operator* @@ -129,15 +125,11 @@ template< class T > struct sp_dereference< T[] > typedef void type; }; -#if !defined( BOOST_BORLANDC ) || !BOOST_WORKAROUND( BOOST_BORLANDC, < 0x600 ) - template< class T, std::size_t N > struct sp_dereference< T[N] > { typedef void type; }; -#endif - #endif // !defined( BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION ) // sp_member_access, return type of operator-> @@ -154,15 +146,11 @@ template< class T > struct sp_member_access< T[] > typedef void type; }; -#if !defined( BOOST_BORLANDC ) || !BOOST_WORKAROUND( BOOST_BORLANDC, < 0x600 ) - template< class T, std::size_t N > struct sp_member_access< T[N] > { typedef void type; }; -#endif - #endif // !defined( BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION ) // sp_array_access, return type of operator[] @@ -179,15 +167,11 @@ template< class T > struct sp_array_access< T[] > typedef T & type; }; -#if !defined( BOOST_BORLANDC ) || !BOOST_WORKAROUND( BOOST_BORLANDC, < 0x600 ) - template< class T, std::size_t N > struct sp_array_access< T[N] > { typedef T & type; }; -#endif - #endif // !defined( BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION ) // sp_extent, for operator[] index check diff --git a/test/smart_ptr_test.cpp b/test/smart_ptr_test.cpp index ca055dc..b6be6b3 100644 --- a/test/smart_ptr_test.cpp +++ b/test/smart_ptr_test.cpp @@ -31,10 +31,6 @@ #endif -#ifdef BOOST_BORLANDC -# pragma warn -8092 // template argument passed to 'find' is not an iterator -#endif - #include #include