From 4fbf783052b44692656c1aad8eb01616bb5f7f4f Mon Sep 17 00:00:00 2001 From: Amlal EL Mahrouss Date: Sun, 6 Oct 2024 11:08:00 +0200 Subject: IMP: Add exit.hxx, which takes care of exiting the program. Signed-off-by: Amlal EL Mahrouss --- dev/crt/base_exception.hxx | 8 ++------ dev/crt/exit.hxx | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+), 6 deletions(-) create mode 100644 dev/crt/exit.hxx (limited to 'dev') diff --git a/dev/crt/base_exception.hxx b/dev/crt/base_exception.hxx index 9d3fd208..e73ac11b 100644 --- a/dev/crt/base_exception.hxx +++ b/dev/crt/base_exception.hxx @@ -7,18 +7,14 @@ #pragma once #include - -/// @brief CRT exit, with exit code (!!! exits all threads. !!!) -/// @param code -/// @return -extern "C" int __exit(int code); +#include /// @brief Standard C++ namespace namespace std { inline void __throw_general(void) { - __exit(33); + exit(33); } inline void __throw_domain_error(const char* error) diff --git a/dev/crt/exit.hxx b/dev/crt/exit.hxx new file mode 100644 index 00000000..a699cacd --- /dev/null +++ b/dev/crt/exit.hxx @@ -0,0 +1,18 @@ +/* ------------------------------------------- + + Copyright ZKA Technologies. + +------------------------------------------- */ + +#pragma once + +extern "C" int exit(int code); + +/// @brief Standard C++ namespace +namespace std +{ + inline int exit(int code) + { + exit(code); + } +} // namespace std \ No newline at end of file -- cgit v1.2.3