From 421db65331663304466577b7187780d9eba18077 Mon Sep 17 00:00:00 2001 From: Amlal Date: Sat, 28 Sep 2024 19:13:46 +0200 Subject: feat: Add common XPCOM controls directory, restructure project, and introduce API breaking changes - Added a new directory for common XPCOM controls to organize reusable components. - Restructured project layout for better modularity and maintainability. - Introduced API breaking changes in the process, requiring adjustments for backward compatibility. Signed-off-by: Amlal --- dev/crt/base_exception.hxx | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 dev/crt/base_exception.hxx (limited to 'dev/crt/base_exception.hxx') diff --git a/dev/crt/base_exception.hxx b/dev/crt/base_exception.hxx new file mode 100644 index 00000000..9d3fd208 --- /dev/null +++ b/dev/crt/base_exception.hxx @@ -0,0 +1,35 @@ +/* ------------------------------------------- + + Copyright ZKA Technologies. + +------------------------------------------- */ + +#pragma once + +#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); + } + + inline void __throw_domain_error(const char* error) + { + __throw_general(); + __builtin_unreachable(); // prevent from continuing. + } + + inline void __throw_bad_array_new_length(void) + { + __throw_general(); + __builtin_unreachable(); // prevent from continuing. + } +} // namespace std -- cgit v1.2.3