Skip to content

Commit

Permalink
Specify __cdecl for the terminate handler on MSVC, fixes #197
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremy-rifkin committed Dec 31, 2024
1 parent d5a2043 commit 0c40839
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
6 changes: 6 additions & 0 deletions src/utils/common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 0c40839

Please sign in to comment.