LibC: Allow including assert.h multiple times

Some shit seems to depend on this
This commit is contained in:
Bananymous 2026-04-02 15:38:06 +03:00
parent 82d5d9ba58
commit e01e35713b
1 changed files with 8 additions and 6 deletions

View File

@ -1,3 +1,11 @@
#ifndef assert
#ifdef NDEBUG
#define assert(ignore) ((void)0)
#else
#define assert(expr) ((expr) ? (void)0 : __assert_fail(#expr, __FILE__, __LINE__, __func__))
#endif
#endif
#ifndef _ASSERT_H
#define _ASSERT_H 1
@ -5,12 +13,6 @@
#include <sys/cdefs.h>
#ifdef NDEBUG
#define assert(ignore) ((void)0)
#else
#define assert(expr) ((expr) ? (void)0 : __assert_fail(#expr, __FILE__, __LINE__, __func__))
#endif
#if !defined(__cplusplus) && __STDC_VERSION__ >= 201112L && __STDC_VERSION__ < 202311L
#define static_assert _Static_assert
#endif