From b112e21f9017b90e3fc48c85383eb368033a97d0 Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Sun, 24 Aug 2025 22:19:39 +0200 Subject: feat: LibC++: improve `exit` function. Signed-off-by: Amlal El Mahrouss --- dev/LibC++/base_process.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'dev/LibC++') diff --git a/dev/LibC++/base_process.h b/dev/LibC++/base_process.h index a30ccca..034240f 100644 --- a/dev/LibC++/base_process.h +++ b/dev/LibC++/base_process.h @@ -24,16 +24,16 @@ inline int signal(int code) { return -1; } -extern "C" void (*__atexit__cdecl_ptr)(void); +extern "C" void (*__atexit_cdecl_ptr)(void); extern "C" void (**__atexit_lst_ptr)(void); extern "C" size_t __atexit_lst_cnt; -inline int exit(int code) { +inline int32_t exit(const int32_t& code) { for (auto idx = 0UL; idx < __atexit_lst_cnt; ++idx) { __atexit_lst_ptr[idx](); } - if (__atexit__cdecl_ptr) __atexit__cdecl_ptr(); + if (__atexit_cdecl_ptr) __atexit_cdecl_ptr(); exit_(code); return -1; -- cgit v1.2.3