From 52054c72893f87ed8fd71f38c316c75b2cc0e566 Mon Sep 17 00:00:00 2001 From: Ryan Saunders Date: Sun, 6 Apr 2025 22:59:42 -0700 Subject: [PATCH] Fix __FUNCSIG__ parsing on x86 by explicitly declaring the calling convention --- include/magic_enum/magic_enum.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/magic_enum/magic_enum.hpp b/include/magic_enum/magic_enum.hpp index 7491fae..b093772 100644 --- a/include/magic_enum/magic_enum.hpp +++ b/include/magic_enum/magic_enum.hpp @@ -418,7 +418,7 @@ template inline constexpr bool is_enum_v = std::is_enum_v && std::is_same_v>; template -constexpr auto n() noexcept { +constexpr auto __cdecl n() noexcept { static_assert(is_enum_v, "magic_enum::detail::n requires enum type."); if constexpr (supported::value) { @@ -494,7 +494,7 @@ template inline constexpr auto type_name_v = type_name(); template -constexpr auto n() noexcept { +constexpr auto __cdecl n() noexcept { static_assert(is_enum_v, "magic_enum::detail::n requires enum type."); if constexpr (supported::value) { @@ -566,7 +566,7 @@ constexpr auto n() noexcept { #if defined(MAGIC_ENUM_VS_2017_WORKAROUND) template -constexpr auto n() noexcept { +constexpr auto __cdecl n() noexcept { static_assert(is_enum_v, "magic_enum::detail::n requires enum type."); # if defined(MAGIC_ENUM_GET_ENUM_NAME_BUILTIN)