Skip to content

Commit

Permalink
Merged revision(s) 19809 from trunk/OpenMPT:
Browse files Browse the repository at this point in the history
[Fix] Crypto++: Work-around <weidai11/cryptopp#1240> by partially reverting <weidai11/cryptopp@e65fa00>.
........


git-svn-id: https://source.openmpt.org/svn/openmpt/branches/OpenMPT-1.31@19810 56274372-70c3-4bfc-bfc3-4c3a0b034d27
  • Loading branch information
manxorist committed Oct 2, 2023
1 parent 2d87335 commit 61fbfe3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
4 changes: 4 additions & 0 deletions include/cryptopp/OpenMPT.txt
Original file line number Diff line number Diff line change
@@ -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
<https://github.com/weidai11/cryptopp/issues/1240> and
<https://github.com/weidai11/cryptopp/commit/e65fa006bec60192112f0a3f23174ef0528f8cc4>.
* 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.
9 changes: 9 additions & 0 deletions include/cryptopp/cpu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 61fbfe3

Please sign in to comment.