Skip to content

Commit

Permalink
patch to support PowerPC and Windows 32 bits (#7635)
Browse files Browse the repository at this point in the history
## Summary of Changes

Patch required for the acceptance of CGAL-5.6 in vcpkg. The CI system
tests on `x86_windows` (32 bits), and there was an error:
```
D:\installed\x86-windows\include\CGAL/cpp_float.h(30): error C3861: '_BitScanForward64': identifier not found
D:\installed\x86-windows\include\CGAL/cpp_float.h(42): error C3861: '_BitScanReverse64': identifier not found
```
See
microsoft/vcpkg#32896 (comment)

The solution is do disable support for Boost MP on Windows 32 bits. That
patch has been tested with the vcpkg CI, and it worked.

## Release Management

* Affected package(s): Number_types
* Issue(s) solved (if any): patch required by
microsoft/vcpkg#32896
  • Loading branch information
sloriot authored Aug 14, 2023
2 parents db9b8e7 + cf0c6c0 commit d0b188b
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion Number_types/include/CGAL/boost_mp.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,18 @@
// easy solution.
// MSVC had trouble with versions <= 1.69:
// https://github.com/boostorg/multiprecision/issues/98
//
// Disable also on Windows 32 bits
// because CGAL/cpp_float.h assumes _BitScanForward64 is available
// See https://learn.microsoft.com/en-us/cpp/intrinsics/bitscanforward-bitscanforward64
//
// Disable also with PowerPC processors, with Boost<1.80 because of that bug:
// https://github.com/boostorg/multiprecision/pull/421
//
#if !defined CGAL_DO_NOT_USE_BOOST_MP && \
(!defined _MSC_VER || BOOST_VERSION >= 107000)
(!defined _MSC_VER || BOOST_VERSION >= 107000) && \
(!defined _WIN32 || defined _WIN64) && \
(BOOST_VERSION >= 108000 || (!defined _ARCH_PPC && !defined _ARCH_PPC64))
#define CGAL_USE_BOOST_MP 1

#include <CGAL/Quotient.h>
Expand Down

0 comments on commit d0b188b

Please sign in to comment.