aboutsummaryrefslogtreecommitdiff
path: root/vendor/libc-shim/include/assert.h
blob: 4e8cd85a4c2f6a1abc16db8d820c947078a3c3a8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#ifdef __cplusplus
extern "C" {
#endif

#pragma once

#ifdef NDEBUG
#define	assert(e)	((void)0)
#else

#ifdef __FILE_NAME__
#define __ASSERT_FILE_NAME __FILE_NAME__
#else /* __FILE_NAME__ */
#define __ASSERT_FILE_NAME __FILE__
#endif /* __FILE_NAME__ */

void __odin_libc_assert_fail(const char *, const char *, int, const char *);

#define	assert(e) \
    (__builtin_expect(!(e), 0) ? __odin_libc_assert_fail(__func__, __ASSERT_FILE_NAME, __LINE__, #e) : (void)0)

#endif /* NDEBUG */

#define static_assert _Static_assert

#ifdef __cplusplus
}
#endif