diff --git a/src/utils.cpp b/src/utils.cpp index ce2917f..0841841 100644 --- a/src/utils.cpp +++ b/src/utils.cpp @@ -40,7 +40,7 @@ namespace cpptrace { } } - [[noreturn]] void terminate_handler() { + [[noreturn]] void MSVC_CDECL terminate_handler() { // TODO: Support std::nested_exception? try { auto ptr = std::current_exception(); diff --git a/src/utils/common.hpp b/src/utils/common.hpp index faf6779..c15d87f 100644 --- a/src/utils/common.hpp +++ b/src/utils/common.hpp @@ -25,6 +25,12 @@ #define NODISCARD #endif +#if IS_MSVC + #define MSVC_CDECL __cdecl +#else + #define MSVC_CDECL +#endif + namespace cpptrace { namespace detail { static const stacktrace_frame null_frame {