neuray API Programmer's Manual

neuraylib/assert.h File Reference

Description

Assertions and compile-time assertions. See Neuray API Assertions.

Code Example

neuraylib/assert.h

‎/***************************************************************************************************
 * Copyright 2023 NVIDIA Corporation. All rights reserved.
 **************************************************************************************************/

#ifndef MI_NEURAYLIB_ASSERT_H
#define MI_NEURAYLIB_ASSERT_H

#include <mi/base/config.h>
#include <mi/base/assert.h>

namespace mi  {

namespace neuraylib {

// --------------------------------------------------------------------
//
//  Assertions
//
// --------------------------------------------------------------------
#if       defined( mi_neuray_assert) && ! defined( mi_neuray_assert_msg) \
     || ! defined( mi_neuray_assert) &&   defined( mi_neuray_assert_msg)
error "Only one of mi_neuray_assert and mi_neuray_assert_msg has been defined. Please define both."
#else
#ifndef mi_neuray_assert


#define mi_neuray_assert(expr) mi_base_assert(expr)

#define mi_neuray_assert_msg(expr, msg) mi_base_assert_msg(expr, msg)

#endif // mi_neuray_assert
#endif // mi_neuray_assert xor mi_neuray_assert_msg

 // end group mi_neuray_assert

} // namespace neuraylib
} // namespace mi


#endif // MI_NEURAYLIB_ASSERT_H

Namespaces

namespace 
Common namespace for APIs of NVIDIA Advanced Rendering Center GmbH. More...
namespace 
Namespace for the neuray API. More...

Defines

#define  ( expr) mi_base_assert(expr)
If expr evaluates to true this macro shall have no effect. More...
#define  ( expr, msg)
If expr evaluates to true this macro shall have no effect. More...