Files
mm/include/libc/assert.h
T
Tharo fc8d1165c8 [Audio 9/9] Loose ends (#1755)
* [Audio 9/9] Loose ends

* Fix sampleconv memset bug

* Doc updates from oot
2024-12-13 16:27:45 -08:00

22 lines
534 B
C

#ifndef LIBC_ASSERT_H
#define LIBC_ASSERT_H
// Static/compile-time assertions
#if !defined(__sgi) && (__STDC_VERSION__ >= 202311L)
// static_assert is a keyword in C23, do not define it
#elif !defined(__sgi) && (__STDC_VERSION__ >= 201112L)
# define static_assert(cond, msg) _Static_assert(cond, msg)
#else
# ifndef GLUE
# define GLUE(a, b) a##b
# endif
# ifndef GLUE2
# define GLUE2(a, b) GLUE(a, b)
# endif
# define static_assert(cond, msg) typedef char GLUE2(static_assertion_failed, __LINE__)[(cond) ? 1 : -1]
#endif
#endif