1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 20:07:35 +00:00

LibC: Make it possible to use ASSERTs without initializing stdio

This commit is contained in:
Itamar 2020-10-10 17:47:21 +03:00 committed by Andreas Kling
parent b1c1d7661f
commit 65ee2f07b7
4 changed files with 7 additions and 1 deletions

View file

@ -27,15 +27,18 @@
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/internals.h>
#include <unistd.h>
extern "C" {
extern bool __stdio_is_initialized;
#ifdef DEBUG
void __assertion_failed(const char* msg)
{
dbgprintf("USERSPACE(%d) ASSERTION FAILED: %s\n", getpid(), msg);
fprintf(stderr, "ASSERTION FAILED: %s\n", msg);
if (__stdio_is_initialized)
fprintf(stderr, "ASSERTION FAILED: %s\n", msg);
abort();
}
#endif