mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 07:08:10 +00:00
LibC: Move _abort
next to abort
It should be now the only user of it, and it is more logical to have it in `stdlib.h` than in `assert.h`
This commit is contained in:
parent
2c62d51e25
commit
0bfb7f9675
4 changed files with 8 additions and 8 deletions
|
@ -33,9 +33,3 @@ void __assertion_failed(const char* msg)
|
||||||
abort();
|
abort();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void _abort()
|
|
||||||
{
|
|
||||||
asm volatile("ud2");
|
|
||||||
__builtin_unreachable();
|
|
||||||
}
|
|
||||||
|
|
|
@ -23,8 +23,6 @@ __attribute__((noreturn)) void __assertion_failed(const char* msg);
|
||||||
# define assert(expr) ((void)(0))
|
# define assert(expr) ((void)(0))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
__attribute__((noreturn)) void _abort();
|
|
||||||
|
|
||||||
#ifndef __cplusplus
|
#ifndef __cplusplus
|
||||||
# define static_assert _Static_assert
|
# define static_assert _Static_assert
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -209,6 +209,12 @@ int atexit(void (*handler)())
|
||||||
return __cxa_atexit(__atexit_to_cxa_atexit, (void*)handler, nullptr);
|
return __cxa_atexit(__atexit_to_cxa_atexit, (void*)handler, nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void _abort()
|
||||||
|
{
|
||||||
|
asm volatile("ud2");
|
||||||
|
__builtin_unreachable();
|
||||||
|
}
|
||||||
|
|
||||||
void abort()
|
void abort()
|
||||||
{
|
{
|
||||||
// For starters, send ourselves a SIGABRT.
|
// For starters, send ourselves a SIGABRT.
|
||||||
|
|
|
@ -16,6 +16,8 @@ __BEGIN_DECLS
|
||||||
#define EXIT_FAILURE 1
|
#define EXIT_FAILURE 1
|
||||||
#define MB_CUR_MAX 4
|
#define MB_CUR_MAX 4
|
||||||
|
|
||||||
|
__attribute__((noreturn)) void _abort();
|
||||||
|
|
||||||
__attribute__((malloc)) __attribute__((alloc_size(1))) void* malloc(size_t);
|
__attribute__((malloc)) __attribute__((alloc_size(1))) void* malloc(size_t);
|
||||||
__attribute__((malloc)) __attribute__((alloc_size(1, 2))) void* calloc(size_t nmemb, size_t);
|
__attribute__((malloc)) __attribute__((alloc_size(1, 2))) void* calloc(size_t nmemb, size_t);
|
||||||
size_t malloc_size(void*);
|
size_t malloc_size(void*);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue