Fix PMP on i386/i686 (32 bits, with the x87 FPU) (#8911)

## Summary of Changes

Fix PMP on i386/i686 (32 bits, with the x87 FPU).

## Release Management

* Affected package(s): PMP, Number_types
This commit is contained in:
Sebastien Loriot 2025-11-20 10:28:31 +01:00 committed by GitHub
commit 3ebe9203a7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 16 additions and 5 deletions

View File

@ -476,6 +476,9 @@ typedef int FPU_CW_t;
#define CGAL_FE_DOWNWARD FE_DOWNWARD #define CGAL_FE_DOWNWARD FE_DOWNWARD
#endif #endif
#define CGAL_FE_ROUNDING_MASK ((CGAL_FE_TONEAREST | CGAL_FE_TOWARDZERO | CGAL_FE_UPWARD | CGAL_FE_DOWNWARD) \
& ~(CGAL_FE_TONEAREST & CGAL_FE_TOWARDZERO & CGAL_FE_UPWARD & CGAL_FE_DOWNWARD)) // mask for rounding bits
// User interface: // User interface:
inline inline
@ -484,7 +487,8 @@ FPU_get_cw (void)
{ {
#ifdef CGAL_ALWAYS_ROUND_TO_NEAREST #ifdef CGAL_ALWAYS_ROUND_TO_NEAREST
CGAL_assertion_code(FPU_CW_t cw; CGAL_IA_GETFPCW(cw);) CGAL_assertion_code(FPU_CW_t cw; CGAL_IA_GETFPCW(cw);)
CGAL_assertion(cw == CGAL_FE_TONEAREST); CGAL_assertion_code(FPU_CW_t mask = CGAL_FE_ROUNDING_MASK;)
CGAL_assertion((cw & mask) == (CGAL_FE_TONEAREST & mask));
return CGAL_FE_TONEAREST; return CGAL_FE_TONEAREST;
#else #else
FPU_CW_t cw; FPU_CW_t cw;

View File

@ -34,6 +34,7 @@
#include <CGAL/iterator.h> #include <CGAL/iterator.h>
#include <CGAL/boost/graph/Face_filtered_graph.h> #include <CGAL/boost/graph/Face_filtered_graph.h>
#if defined(CGAL_METIS_ENABLED) #if defined(CGAL_METIS_ENABLED)
#include <CGAL/boost/graph/partition.h> #include <CGAL/boost/graph/partition.h>
#endif // CGAL_METIS_ENABLED #endif // CGAL_METIS_ENABLED
@ -42,14 +43,16 @@
#include <tbb/parallel_reduce.h> #include <tbb/parallel_reduce.h>
#include <tbb/blocked_range.h> #include <tbb/blocked_range.h>
#endif // CGAL_LINKED_WITH_TBB #endif // CGAL_LINKED_WITH_TBB
#if defined(CGAL_LINKED_WITH_TBB) && defined(CGAL_METIS_ENABLED) && defined(USE_PARALLEL_BEHD)
# include <any>
#endif
#include <any>
#include <unordered_set>
#include <algorithm> #include <algorithm>
#include <array> #include <array>
#include <cmath> #include <cmath>
#include <limits> #include <limits>
#include <type_traits>
#include <unordered_set>
#ifdef CGAL_HAUSDORFF_DEBUG_PP #ifdef CGAL_HAUSDORFF_DEBUG_PP
#ifndef CGAL_HAUSDORFF_DEBUG #ifndef CGAL_HAUSDORFF_DEBUG
@ -1467,7 +1470,11 @@ bounded_error_squared_Hausdorff_distance_impl(const TriangleMesh1& tm1,
using Candidate = Candidate_triangle<Kernel, Face_handle_1, Face_handle_2>; using Candidate = Candidate_triangle<Kernel, Face_handle_1, Face_handle_2>;
if constexpr(std::is_floating_point_v<FT>) {
CGAL_precondition(std::nextafter(sq_initial_bound, (std::numeric_limits<FT>::max)()) >= square(FT(error_bound)));
} else {
CGAL_precondition(sq_initial_bound >= square(FT(error_bound))); CGAL_precondition(sq_initial_bound >= square(FT(error_bound)));
}
CGAL_precondition(sq_distance_bound != FT(0)); // value is -1 if unused CGAL_precondition(sq_distance_bound != FT(0)); // value is -1 if unused
CGAL_precondition(tm1_tree.size() > 0); CGAL_precondition(tm1_tree.size() > 0);
CGAL_precondition(tm2_tree.size() > 0); CGAL_precondition(tm2_tree.size() > 0);