Force usage of assert() condition when NDEBUG is defined
[lttng-tools.git] / src / common / optional.h
index ca7d1f043d21bdef1b9ad8dc716452ee49fe7858..dcb7ca8639fd67ddac916ea84816e24e0b2b2b5e 100644 (file)
@@ -9,7 +9,6 @@
 #define LTTNG_OPTIONAL_H
 
 #include <stdint.h>
-#include <assert.h>
 
 /*
  * Define wrapper structure representing an optional value.
 
 /*
  * This macro is available as a 'convenience' to allow sites that assume
- * an optional value is set to assert() that it is set when accessing it.
+ * an optional value is set to LTTNG_ASSERT() that it is set when accessing it.
  *
  * Since this returns the 'optional' by value, it is not suitable for all
  * wrapped optional types. It is meant to be used with PODs.
  */
 #define LTTNG_OPTIONAL_GET(optional)                   \
        ({                                              \
-               assert((optional).is_set);              \
+               LTTNG_ASSERT((optional).is_set);                \
                (optional).value;                       \
        })
 
 /*
  * This macro is available as a 'convenience' to allow sites that assume
- * an optional value is set to assert() that it is set when fecthing the
+ * an optional value is set to LTTNG_ASSERT() that it is set when fecthing the
  * underlying value's address.
  */
 #define LTTNG_OPTIONAL_GET_PTR(optional)                       \
        ({                                              \
-               assert((optional).is_set);              \
+               LTTNG_ASSERT((optional).is_set);                \
                &(optional).value;                      \
        })
 
This page took 0.024124 seconds and 4 git commands to generate.