From b4d7338dea3ba75b5c9a5eef681a3cf3e3c46829 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C3=A5rd=20Sigurd=20M=C3=B8ller?= Date: Fri, 27 May 2022 14:53:13 +0200 Subject: [PATCH 1/2] Fix compilation error, when including magic_enum after windows.h --- include/magic_enum.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/magic_enum.hpp b/include/magic_enum.hpp index c6a48fb45..4daab7d61 100644 --- a/include/magic_enum.hpp +++ b/include/magic_enum.hpp @@ -739,7 +739,7 @@ struct constexpr_hash_t(2166136261ULL); for (const auto c : value) { - acc = ((acc ^ static_cast(c)) * static_cast(16777619ULL)) & std::numeric_limits::max(); + acc = (((acc ^ static_cast(c)) * static_cast(16777619ULL)) & std::numeric_limits::max)(); } return static_cast(acc); } From 999c2af7212ae962e24e6dbfe1bd27f9fce019ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C3=A5rd=20Sigurd=20M=C3=B8ller?= Date: Sat, 28 May 2022 17:27:18 +0200 Subject: [PATCH 2/2] Put the bracket at the correct spot --- include/magic_enum.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/magic_enum.hpp b/include/magic_enum.hpp index 4daab7d61..886f888c2 100644 --- a/include/magic_enum.hpp +++ b/include/magic_enum.hpp @@ -739,7 +739,7 @@ struct constexpr_hash_t(2166136261ULL); for (const auto c : value) { - acc = (((acc ^ static_cast(c)) * static_cast(16777619ULL)) & std::numeric_limits::max)(); + acc = ((acc ^ static_cast(c)) * static_cast(16777619ULL)) & (std::numeric_limits::max)(); } return static_cast(acc); }