banan-os/libc/stdlib/abort.cpp

18 lines
270 B
C++
Raw Normal View History

#include <stdlib.h>
#include <stdio.h>
2022-11-14 18:53:00 +02:00
#if defined(__is_libk)
#include <kernel/panic.h>
#endif
__attribute__((__noreturn__))
void abort(void)
{
#if defined(__is_libk)
2022-11-14 18:53:00 +02:00
Kernel::panic("abort()");
#else
printf("abort()\n");
#endif
while (1);
__builtin_unreachable();
}