Skip to content

Commit

Permalink
Use BOOST_ASSERT but disable assertions on older GCC
Browse files Browse the repository at this point in the history
  • Loading branch information
glenfe committed Jan 18, 2025
1 parent b9a2221 commit 787b03e
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions include/boost/core/detail/assert.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,12 @@ Distributed under the Boost Software License, Version 1.0.
*/
#undef BOOST_CORE_DETAIL_ASSERT

#include <cassert>

#if !defined(NDEBUG) && \
!defined(__clang__) && \
#if !defined(__clang__) && \
!defined(__INTEL_COMPILER) && \
defined(__GNUC__) && \
(__GNUC__ < 5)
#define BOOST_CORE_DETAIL_ASSERT(expr) \
((expr) ? void(0) : __assert_fail(#expr, __FILE__, __LINE__, 0))
#define BOOST_CORE_DETAIL_ASSERT(expr) void(0)
#else
#define BOOST_CORE_DETAIL_ASSERT(expr) assert(expr)
#include <boost/assert.hpp>
#define BOOST_CORE_DETAIL_ASSERT(expr) BOOST_ASSERT(expr)
#endif

0 comments on commit 787b03e

Please sign in to comment.