From f900849f98bad9988805ec89c587395752490486 Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Sat, 29 Nov 2025 22:21:44 -0500 Subject: chore: API and system design update. Signed-off-by: Amlal El Mahrouss --- src/LibC++/__abi+unreachable.cc | 3 +-- src/LibC++/__abi.h | 2 +- src/LibC++/base_process.h | 36 ++++++++++++++++++------------------ src/LibC++/defines.h | 8 ++++---- 4 files changed, 24 insertions(+), 25 deletions(-) (limited to 'src/LibC++') diff --git a/src/LibC++/__abi+unreachable.cc b/src/LibC++/__abi+unreachable.cc index 1fc9830..5628e7d 100644 --- a/src/LibC++/__abi+unreachable.cc +++ b/src/LibC++/__abi+unreachable.cc @@ -12,6 +12,5 @@ static const int32_t __unreachable_code = 34; extern "C" void __compilerkit_unreachable(void) { std::base_process::signal(__unreachable_code); - while (1) - ; + while (1); } \ No newline at end of file diff --git a/src/LibC++/__abi.h b/src/LibC++/__abi.h index 70afae5..206b5ef 100644 --- a/src/LibC++/__abi.h +++ b/src/LibC++/__abi.h @@ -10,6 +10,6 @@ __init_decl() -extern void __compilerkit_unreachable(void); + extern void __compilerkit_unreachable(void); __fini_decl() \ No newline at end of file diff --git a/src/LibC++/base_process.h b/src/LibC++/base_process.h index f9b0596..cb25aa1 100644 --- a/src/LibC++/base_process.h +++ b/src/LibC++/base_process.h @@ -10,10 +10,10 @@ __init_decl() -/// @brief CRT exit, with exit code (!!! exits all threads. !!!) -/// @param code the exit code. -/// @return the return > 0 for non successful. -extern int exit_(int code); + /// @brief CRT exit, with exit code (!!! exits all threads. !!!) + /// @param code the exit code. + /// @return the return > 0 for non successful. + extern int exit_(int code); /// @brief CRT signal handler. /// @param code the signal code. @@ -25,21 +25,21 @@ extern size_t __atexit_lst_cnt; __fini_decl() -/// @brief Standard C++ namespace -namespace std::base_process { -inline int signal(int code) { - signal_(code); - return -1; -} - -inline int32_t exit(const int32_t& code) { - for (auto idx = 0UL; idx < __atexit_lst_cnt; ++idx) { - __atexit_lst_ptr[idx](); + /// @brief Standard C++ namespace + namespace std::base_process { + inline int signal(int code) { + signal_(code); + return -1; } - if (__atexit_cdecl_ptr) __atexit_cdecl_ptr(); + 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(); - exit_(code); - return -1; -} + exit_(code); + return -1; + } } // namespace std::base_process diff --git a/src/LibC++/defines.h b/src/LibC++/defines.h index b8ef10c..9293bc2 100644 --- a/src/LibC++/defines.h +++ b/src/LibC++/defines.h @@ -17,10 +17,10 @@ typedef void* ptr_type; typedef __SIZE_TYPE__ size_type; typedef __INT64_TYPE__ ptrdiff_t; -typedef size_t uintptr_t; -typedef void* voidptr_t; -typedef void* any_t; -typedef char* caddr_t; +typedef size_t uintptr_t; +typedef void* voidptr_t; +typedef void* any_t; +typedef char* caddr_t; #ifndef NULL #define NULL ((voidptr_t) 0) -- cgit v1.2.3