summaryrefslogtreecommitdiffhomepage
path: root/dev/LibC++
diff options
context:
space:
mode:
Diffstat (limited to 'dev/LibC++')
-rw-r--r--dev/LibC++/base_process.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/dev/LibC++/base_process.h b/dev/LibC++/base_process.h
index 126ac60..900198f 100644
--- a/dev/LibC++/base_process.h
+++ b/dev/LibC++/base_process.h
@@ -12,7 +12,10 @@
/// @param code the exit code.
/// @return the return > 0 for non successful.
extern "C" int exit_(int code);
-extern "C" int signal_(int code);
+
+/// @brief CRT signal handler.
+/// @param code the signal code.
+extern "C" void signal_(int code);
/// @brief Standard C++ namespace
namespace std::base_process {
@@ -21,7 +24,14 @@ inline int signal(int code) {
return -1;
}
+extern "C" void (*__atexit_lst_ptr)(void);
+extern "C" size_t __atexit_lst_cnt;
+
inline int exit(int code) {
+ for (auto i = 0UL; i < __atexit_lst_cnt; ++i) {
+ __atexit_lst_ptr();
+ }
+
exit_(code);
return -1;
}