diff --git a/include/cryptopp/OpenMPT.txt b/include/cryptopp/OpenMPT.txt index 598e9672a39..8784213a8e5 100644 --- a/include/cryptopp/OpenMPT.txt +++ b/include/cryptopp/OpenMPT.txt @@ -1,5 +1,9 @@ cryptp++ library version 8.9.0 (2023-10-01). The following changes have been made: + * `cpu.c`has been fixed for MSVC x64 builds. See + and + . + * Modifications are marked by `// OpenMPT` or `/* OpenMPT */`. * Obviously, unnecessary folders and files have been removed. * For building, premake is used to generate Visual Studio project files. See ../build/premake/ for details. diff --git a/include/cryptopp/cpu.cpp b/include/cryptopp/cpu.cpp index ab25bea9f1f..2ad3b46f4c4 100644 --- a/include/cryptopp/cpu.cpp +++ b/include/cryptopp/cpu.cpp @@ -392,7 +392,11 @@ word64 XGetBV(word32 num) // Use it for all MSVC-compatible compilers. #if defined(_M_X64) && defined(CRYPTOPP_MS_STYLE_INLINE_ASSEMBLY) +#if defined(CRYPTOPP_MSC_VERSION) && (_MSC_FULL_VER >= 160040219) /* OpenMPT */ + return _xgetbv(num); /* OpenMPT */ +#else /* OpenMPT */ return XGETBV64(num); +#endif /* OpenMPT */ // Required by Visual Studio 2008 and below and Clang on Windows. // Use it for all MSVC-compatible compilers. @@ -450,8 +454,13 @@ bool CpuId(word32 func, word32 subfunc, word32 output[4]) // Use it for all MSVC-compatible compilers. #if defined(_M_X64) && defined(CRYPTOPP_MS_STYLE_INLINE_ASSEMBLY) +#if defined(CRYPTOPP_MSC_VERSION) && ((CRYPTOPP_MSC_VERSION >= 1600)) /* OpenMPT */ + __cpuidex((int *)output, func, subfunc); /* OpenMPT */ + return true; /* OpenMPT */ +#else /* OpenMPT */ CPUID64(func, subfunc, output); return true; +#endif /* OpenMPT */ // Required by Visual Studio 2008 and below and Clang on Windows. // Use it for all MSVC-compatible compilers.