9#ifndef MI_BASE_ASSERT_H
10#define MI_BASE_ASSERT_H
52#ifndef mi_static_assert
55#define mi_static_assert(expr) \
56 typedef mi::base::static_assert_test<static_cast<int>( \
57 sizeof(mi::base::static_assert_failure<static_cast<bool>((expr))>))> \
58 MI_BASE_JOIN(static_assert_instance, __COUNTER__)
61#define mi_static_assert_attribute __attribute__((unused))
63#define mi_static_assert_attribute
65#define mi_static_assert(expr) \
66 typedef mi::base::static_assert_test<static_cast<int>( \
67 sizeof(mi::base::static_assert_failure<static_cast<bool>((expr))>))> \
68 MI_BASE_JOIN(static_assert_instance, __LINE__) mi_static_assert_attribute
73template <
bool>
struct static_assert_failure;
74template <>
struct static_assert_failure<true> {};
75template <
int>
struct static_assert_test {};
77#if defined( mi_base_assert) && ! defined( mi_base_assert_msg) \
78 || ! defined( mi_base_assert) && defined( mi_base_assert_msg)
79error "Only one of mi_base_assert and mi_base_assert_msg has been defined. Please define both."
94#define mi_base_assert(expr) (static_cast<void>(0))
111#define mi_base_assert_msg(expr, msg) (static_cast<void>(0))
119#define mi_base_assert_enabled
120#undef mi_base_assert_enabled
126#define mi_base_assert_enabled
140#if defined(__FUNCSIG__)
141# define MI_BASE_ASSERT_FUNCTION __FUNCSIG__
142#elif defined( __cplusplus) && defined(__GNUC__) && defined(__GNUC_MINOR__) \
143 && ((__GNUC__ << 16) + __GNUC_MINOR__ >= (2 << 16) + 6)
144# define MI_BASE_ASSERT_FUNCTION __PRETTY_FUNCTION__
146# if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L
147# define MI_BASE_ASSERT_FUNCTION __func__
149# define MI_BASE_ASSERT_FUNCTION ("unknown")
Configuration of the Base API.
std::basic_ostream<C, T> & error(std::basic_ostream<C, T> &ostream)
Manipulator for mi::base::Log_stream.
Definition: ilogger.h:542
Common namespace for APIs of NVIDIA Advanced Rendering Center GmbH.
Definition: dice.h:89