Skip to content

Commit

Permalink
Update contrib/restricted/boost/intrusive to 1.82.0
Browse files Browse the repository at this point in the history
  • Loading branch information
robot-piglet committed Apr 29, 2023
1 parent 8a8de64 commit 95043ce
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 17 deletions.
1 change: 0 additions & 1 deletion contrib/restricted/boost/intrusive/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ target_link_libraries(restricted-boost-intrusive INTERFACE
restricted-boost-assert
restricted-boost-config
restricted-boost-container_hash
restricted-boost-core
restricted-boost-move
restricted-boost-static_assert
)
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@

#include <boost/intrusive/detail/config_begin.hpp>
#include <boost/intrusive/intrusive_fwd.hpp>
#include <boost/intrusive/detail/workaround.hpp>
#include <boost/intrusive/detail/algo_type.hpp>
#include <boost/core/no_exceptions_support.hpp>
#include <cstddef>

#if defined(BOOST_HAS_PRAGMA_ONCE)
Expand Down Expand Up @@ -405,7 +405,7 @@ class circular_list_algorithms
new_f = cur;
bcur = cur;
cur = node_traits::get_next(cur);
BOOST_TRY{
BOOST_INTRUSIVE_TRY{
//Main loop
while(cur != end){
if(pred(cur)){ //Might throw
Expand All @@ -426,12 +426,12 @@ class circular_list_algorithms
}
}
}
BOOST_CATCH(...){
BOOST_INTRUSIVE_CATCH(...){
node_traits::set_next (last_to_remove, new_f);
node_traits::set_previous(new_f, last_to_remove);
BOOST_RETHROW;
BOOST_INTRUSIVE_RETHROW;
}
BOOST_CATCH_END
BOOST_INTRUSIVE_CATCH_END
node_traits::set_next(last_to_remove, new_f);
node_traits::set_previous(new_f, last_to_remove);
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#endif

#include <boost/config.hpp>
#include <boost/core/no_exceptions_support.hpp>
#include <boost/intrusive/detail/workaround.hpp>
#include <boost/move/detail/placement_new.hpp>
#include <boost/move/detail/force_ptr.hpp>

Expand Down Expand Up @@ -55,20 +55,20 @@ class array_initializer
{
char *init_buf = (char*)rawbuf;
std::size_t i = 0;
BOOST_TRY{
BOOST_INTRUSIVE_TRY{
for(; i != N; ++i){
::new(init_buf, boost_move_new_t()) T(init);
init_buf += sizeof(T);
}
}
BOOST_CATCH(...){
BOOST_INTRUSIVE_CATCH(...){
while(i--){
init_buf -= sizeof(T);
move_detail::force_ptr<T*>(init_buf)->~T();
}
BOOST_RETHROW;
BOOST_INTRUSIVE_RETHROW;
}
BOOST_CATCH_END
BOOST_INTRUSIVE_CATCH_END
}

operator T* ()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
#endif

#include <boost/intrusive/intrusive_fwd.hpp>
#include <boost/intrusive/detail/workaround.hpp>
#include <boost/intrusive/detail/assert.hpp>
#include <boost/intrusive/detail/algo_type.hpp>
#include <boost/core/no_exceptions_support.hpp>
#include <cstddef>

namespace boost {
Expand Down Expand Up @@ -126,7 +126,7 @@ class common_slist_algorithms
new_f = cur;
bcur = cur;
cur = node_traits::get_next(cur);
BOOST_TRY{
BOOST_INTRUSIVE_TRY{
//Main loop
while(cur != end){
if(pred(cur)){ //Might throw
Expand All @@ -145,11 +145,11 @@ class common_slist_algorithms
}
}
}
BOOST_CATCH(...){
BOOST_INTRUSIVE_CATCH(...){
node_traits::set_next(last_to_remove, new_f);
BOOST_RETHROW;
BOOST_INTRUSIVE_RETHROW;
}
BOOST_CATCH_END
BOOST_INTRUSIVE_CATCH_END
node_traits::set_next(last_to_remove, new_f);
break;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include <boost/intrusive/detail/mpl.hpp>
#include <boost/move/detail/to_raw_pointer.hpp>
#include <boost/intrusive/detail/node_holder.hpp>
#include <boost/assert.hpp>

namespace boost {
namespace intrusive {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,30 @@
#define BOOST_INTRUSIVE_FORCEINLINE BOOST_FORCEINLINE
#endif

#if !(defined BOOST_NO_EXCEPTIONS)
# define BOOST_INTRUSIVE_TRY { try
# define BOOST_INTRUSIVE_CATCH(x) catch(x)
# define BOOST_INTRUSIVE_RETHROW throw;
# define BOOST_INTRUSIVE_CATCH_END }
#else
# if !defined(BOOST_MSVC) || BOOST_MSVC >= 1900
# define BOOST_INTRUSIVE_TRY { if (true)
# define BOOST_INTRUSIVE_CATCH(x) else if (false)
# else
// warning C4127: conditional expression is constant
# define BOOST_INTRUSIVE_TRY { \
__pragma(warning(push)) \
__pragma(warning(disable: 4127)) \
if (true) \
__pragma(warning(pop))
# define BOOST_INTRUSIVE_CATCH(x) else \
__pragma(warning(push)) \
__pragma(warning(disable: 4127)) \
if (false) \
__pragma(warning(pop))
# endif
# define BOOST_INTRUSIVE_RETHROW
# define BOOST_INTRUSIVE_CATCH_END }
#endif

#endif //#ifndef BOOST_INTRUSIVE_DETAIL_WORKAROUND_HPP
Original file line number Diff line number Diff line change
Expand Up @@ -1348,7 +1348,7 @@ class list_impl
BOOST_INTRUSIVE_INVARIANT_ASSERT(this->priv_size_traits().get_size() == 0);
return;
}
size_t node_count = 0;
size_t node_count = 0; (void)node_count;
const_node_ptr p = header_ptr;
while (true)
{
Expand Down

0 comments on commit 95043ce

Please sign in to comment.