Skip to content

Commit

Permalink
Fix ARM64 windows builds
Browse files Browse the repository at this point in the history
Apparently I looked at the docs for umulh when checking availability,
and umul128 is x64 only.
  • Loading branch information
horenmar committed Apr 12, 2024
1 parent 838f8d7 commit 65794fd
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/catch2/internal/catch_random_integer_helpers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@
// it, and it provides an escape hatch to the users who need it.
#if defined( __SIZEOF_INT128__ )
# define CATCH_CONFIG_INTERNAL_UINT128
#elif defined( _MSC_VER ) && ( defined( _WIN64 ) || defined( _M_ARM64 ) )
// Unlike GCC, MSVC does not polyfill umul as mulh + mul pair on ARM machines.
// Currently we do not bother doing this ourselves, but we could if it became
// important for perf.
#elif defined( _MSC_VER ) && defined( _WIN64 )
# define CATCH_CONFIG_INTERNAL_MSVC_UMUL128
#endif

Expand Down

2 comments on commit 65794fd

@RT2Code
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I stumbled into this issue while trying to update the catch2 vcpkg port, so I used this patch, but it still failed. I fixed it like this : microsoft/vcpkg@b35eca8

@horenmar
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks.

Actually I think the patch is slightly wrong as well, the proper macro to check is either _M_AMD64 or _M_X64. (These seem the same thing based on the docs)

Please sign in to comment.