ouster_clib v1.0
C library for Ouster LiDAR
Loading...
Searching...
No Matches
ouster_assert.h
1
9#ifndef OUSTER_ASSERT_H
10#define OUSTER_ASSERT_H
11
12#include "ouster_clib/ouster_types.h"
13#include "ouster_clib/ouster_os_api.h"
14
15#ifdef __cplusplus
16extern "C" {
17#endif
18
19#ifdef OUSTER_DEBUG
20
21#include <stdint.h>
22#include <stdlib.h>
23
24int ouster_assert_(
25 const char *expr,
26 const char *file,
27 int32_t line,
28 const char *fn,
29 const char *fmt,
30 ...
31 );
32
35#define ouster_assert(expr, ...) ((expr) ? (void)0: (void)(ouster_assert_(#expr, __FILE__, __LINE__, __func__, __VA_ARGS__), abort()))
36
39#define ouster_assert_notnull(expr) ouster_assert(expr, "%s", "Should not be NULL")
40
41
42#else
43#define ouster_assert(expr, ...) ouster_unused(expr)
44#define ouster_assert_notnull(expr) ouster_unused(expr)
45#endif // OUSTER_DEBUG
46
47#ifdef __cplusplus
48}
49#endif
50
51#endif // OUSTER_ASSERT_H
52