From affddb700e1a12a96323b59c2a41f870ccbe45a9 Mon Sep 17 00:00:00 2001 From: Amlal EL Mahrouss Date: Sun, 6 Oct 2024 11:13:33 +0200 Subject: IMP: Add exit.hxx to expose exit function. Signed-off-by: Amlal EL Mahrouss --- dev/crt/base_exception.hxx | 9 ++------- dev/crt/exit.hxx | 21 +++++++++++++++++++++ 2 files changed, 23 insertions(+), 7 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 9d3fd20..bb15eb4 100644 --- a/dev/crt/base_exception.hxx +++ b/dev/crt/base_exception.hxx @@ -7,18 +7,13 @@ #pragma once #include +#include -/// @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 -- cgit v1.2.3