[libc-commits] [libc] [libc] assert.h modifications for newhdrgen (PR #98092)

Michael Jones via libc-commits libc-commits at lists.llvm.org
Thu Jul 11 16:13:47 PDT 2024


================
@@ -12,4 +12,15 @@
 // This file may be usefully included multiple times to change assert()'s
 // definition based on NDEBUG.
 
+
+#undef assert
+#ifdef NDEBUG
+#define assert(e) (void)0
+#else
+
+_Noreturn void __assert_fail(const char *, const char *, unsigned, const char *) __NOEXCEPT;
----------------
michaelrj-google wrote:

this needs the `ifdef __cplusplus` guards so that it's properly `extern "C"` in C mode

https://github.com/llvm/llvm-project/pull/98092


More information about the libc-commits mailing list