NVIDIA Iray: Math API Home  Up
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
assert.h
Go to the documentation of this file.
1 //*****************************************************************************
2 // Copyright 1986, 2016 NVIDIA Corporation. All rights reserved.
3 //*****************************************************************************
8 //*****************************************************************************
9 
10 #ifndef MI_MATH_ASSERT_H
11 #define MI_MATH_ASSERT_H
12 
13 #include <mi/base/config.h>
14 #include <mi/base/assert.h>
15 
16 namespace mi {
17 
18 namespace math {
19 
43 #if defined( mi_math_assert) && ! defined( mi_math_assert_msg) \
44  || ! defined( mi_math_assert) && defined( mi_math_assert_msg)
45 error "Only one of mi_math_assert and mi_math_assert_msg has been defined. Please define both."
46 #else
47 #ifndef mi_math_assert
48 
62 #define mi_math_assert(expr) mi_base_assert(expr)
63 
81 #define mi_math_assert_msg(expr, msg) mi_base_assert_msg(expr, msg)
82 
83 // Just for doxygen, begin
84 
90 #define mi_math_assert_enabled
91 #undef mi_math_assert_enabled
92 
93 // Just for doxygen, end
94 
95 #ifdef mi_base_assert_enabled
96 #define mi_math_assert_enabled
97 #endif // mi_math_assert_enabled
98 
99 #else // mi_math_assert
100 
101 #define mi_math_assert_enabled
102 
103 #endif // mi_math_assert
104 #endif // mi_math_assert xor mi_math_assert_msg
105 
106  // end group mi_math_assert
108 
109 } // namespace math
110 
111 } // namespace mi
112 
113 #endif // MI_MATH_ASSERT_H