diff options
| author | Amlal EL Mahrouss <amlalelmahrouss@icloud.com> | 2024-10-06 11:13:33 +0200 |
|---|---|---|
| committer | Amlal EL Mahrouss <amlalelmahrouss@icloud.com> | 2024-10-06 11:13:33 +0200 |
| commit | affddb700e1a12a96323b59c2a41f870ccbe45a9 (patch) | |
| tree | 8b976c9436d4e910a7197edcc536b547df8eec5e /dev | |
| parent | 6b84827f775179488ea912de37a8af1e06291f94 (diff) | |
IMP: Add exit.hxx to expose exit function.
Signed-off-by: Amlal EL Mahrouss <amlalelmahrouss@icloud.com>
Diffstat (limited to 'dev')
| -rw-r--r-- | dev/crt/base_exception.hxx | 9 | ||||
| -rw-r--r-- | dev/crt/exit.hxx | 21 |
2 files changed, 23 insertions, 7 deletions
diff --git a/dev/crt/base_exception.hxx b/dev/crt/base_exception.hxx index 9d3fd20..bb15eb4 100644 --- a/dev/crt/base_exception.hxx +++ b/dev/crt/base_exception.hxx @@ -7,18 +7,13 @@ #pragma once #include <crt/defines.hxx> +#include <crt/exit.hxx> -/// @brief CRT exit, with exit code (!!! exits all threads. !!!) -/// @param code -/// @return -extern "C" int __exit(int code); - -/// @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 0000000..62278ad --- /dev/null +++ b/dev/crt/exit.hxx @@ -0,0 +1,21 @@ +/* ------------------------------------------- + + Copyright ZKA Technologies. + +------------------------------------------- */ + +#pragma once + +/// @brief CRT exit, with exit code (!!! exits all threads. !!!) +/// @param code +/// @return +extern "C" int exit(int code); + +/// @brief Standard C++ namespace +namespace std +{ + inline int exit(int code) + { + exit(code); + } +} // namespace std |
