Merge branch 'assert-bits' into 'master'

move assert bits from C to cbindgen

See merge request redox-os/relibc!1183
This commit is contained in:
Jeremy Soller
2026-04-12 06:50:45 -06:00
2 changed files with 14 additions and 12 deletions
-11
View File
@@ -1,11 +0,0 @@
// Do not use include guard, to ensure assert is always defined
#ifdef assert
#undef assert
#endif
#ifdef NDEBUG
# define assert(cond) (void) 0
#else
# define assert(cond) \
((void)((cond) || (__assert_fail(__func__, __FILE__, __LINE__, #cond), 0)))
#endif
+14 -1
View File
@@ -5,7 +5,20 @@
# features.h included for Rust never type (no return)
sys_includes = ["features.h"]
include_guard = "_RELIBC_ASSERT_H"
trailer = "#include <bits/assert.h>"
# trailer is placed outside include_guard
trailer = """
// Do not use include guard, to ensure assert is always defined
#ifdef assert
#undef assert
#endif
#ifdef NDEBUG
# define assert(cond) (void) 0
#else
# define assert(cond) \
((void)((cond) || (__assert_fail(__func__, __FILE__, __LINE__, #cond), 0)))
#endif
"""
language = "C"
style = "Tag"
no_includes = true