Use BOOST_ASSERT but disable assertions on older GCC

This commit is contained in:
Glen Fernandes 2025-01-18 17:14:03 -05:00
parent b9a2221b3b
commit 787b03ea9c

View File

@ -7,15 +7,12 @@ Distributed under the Boost Software License, Version 1.0.
*/ */
#undef BOOST_CORE_DETAIL_ASSERT #undef BOOST_CORE_DETAIL_ASSERT
#include <cassert> #if !defined(__clang__) && \
#if !defined(NDEBUG) && \
!defined(__clang__) && \
!defined(__INTEL_COMPILER) && \ !defined(__INTEL_COMPILER) && \
defined(__GNUC__) && \ defined(__GNUC__) && \
(__GNUC__ < 5) (__GNUC__ < 5)
#define BOOST_CORE_DETAIL_ASSERT(expr) \ #define BOOST_CORE_DETAIL_ASSERT(expr) void(0)
((expr) ? void(0) : __assert_fail(#expr, __FILE__, __LINE__, 0))
#else #else
#define BOOST_CORE_DETAIL_ASSERT(expr) assert(expr) #include <boost/assert.hpp>
#define BOOST_CORE_DETAIL_ASSERT(expr) BOOST_ASSERT(expr)
#endif #endif