Go to the documentation of this file.
18 # define OIIO_ABORT_IF_DEBUG abort()
20 # define OIIO_ABORT_IF_DEBUG (void)0
32 #define OIIO_ASSERT(x) \
35 : (std::fprintf(stderr, "%s:%u: %s: Assertion '%s' failed.\n", \
36 __FILE__, __LINE__, OIIO_PRETTY_FUNCTION, #x), \
38 #define OIIO_ASSERT_MSG(x, msg, ...) \
41 : (std::fprintf(stderr, "%s:%u: %s: Assertion '%s' failed: " msg "\n", \
42 __FILE__, __LINE__, OIIO_PRETTY_FUNCTION, #x, \
55 # define OIIO_DASSERT OIIO_ASSERT
56 # define OIIO_DASSERT_MSG OIIO_ASSERT_MSG
58 # define OIIO_DASSERT(x) ((void)sizeof(x))
59 # define OIIO_DASSERT_MSG(x, ...) ((void)sizeof(x))
76 : (std::fprintf(stderr, "%s:%u: %s: Assertion '%s' failed.\n", \
77 __FILE__, __LINE__, OIIO_PRETTY_FUNCTION, #x), \
82 # define ASSERT_MSG(x, msg, ...) \
85 : (std::fprintf(stderr, \
86 "%s:%u: %s: Assertion '%s' failed: " msg "\n", \
87 __FILE__, __LINE__, OIIO_PRETTY_FUNCTION, #x, \
93 # define ASSERTMSG ASSERT_MSG
100 # define DASSERT(x) assert(x)
103 # define DASSERT(x) ((void)sizeof(x))
110 # define DASSERT_MSG ASSERT_MSG
113 # define DASSERT_MSG(x, ...) ((void)sizeof(x))
117 # define DASSERTMSG DASSERT_MSG
123 #if (__cplusplus >= 201700L)
124 # define OIIO_STATIC_ASSERT(cond) static_assert(cond)
126 # define OIIO_STATIC_ASSERT(cond) static_assert(cond, "")
130 #define OIIO_STATIC_ASSERT_MSG(cond, msg) static_assert(cond, msg)