[s2geometry] update to 0.13.1 (#48676)

This commit is contained in:
toge
2025-12-05 07:28:53 +09:00
committed by GitHub
parent df3a73c580
commit 580d480f75
5 changed files with 62 additions and 4 deletions

View File

@@ -0,0 +1,51 @@
diff --git a/src/s2/util/math/exactfloat/exactfloat.cc b/src/s2/util/math/exactfloat/exactfloat.cc
index bd807e2..27aee43 100644
--- a/src/s2/util/math/exactfloat/exactfloat.cc
+++ b/src/s2/util/math/exactfloat/exactfloat.cc
@@ -151,8 +151,8 @@ ExactFloat::ExactFloat(double v) {
// by the number of mantissa bits in a double (53, including the leading
// "1") then the result is always an integer.
int exp;
- double f = frexp(fabs(v), &exp);
- uint64_t m = static_cast<uint64_t>(ldexp(f, kDoubleMantissaBits));
+ double f = std::frexp(std::fabs(v), &exp);
+ uint64_t m = static_cast<uint64_t>(std::ldexp(f, kDoubleMantissaBits));
BN_ext_set_uint64(bn_.get(), m);
bn_exp_ = exp - kDoubleMantissaBits;
Canonicalize();
@@ -163,7 +163,7 @@ ExactFloat::ExactFloat(int v) {
sign_ = (v >= 0) ? 1 : -1;
// Note that this works even for INT_MIN because the parameter type for
// BN_set_word() is unsigned.
- ABSL_CHECK(BN_set_word(bn_.get(), abs(v)));
+ ABSL_CHECK(BN_set_word(bn_.get(), std::abs(v)));
bn_exp_ = 0;
Canonicalize();
}
@@ -239,7 +239,7 @@ ExactFloat::operator double() const {
double ExactFloat::ToDoubleHelper() const {
ABSL_DCHECK_LE(BN_num_bits(bn_.get()), kDoubleMantissaBits);
if (!isnormal(*this)) {
- if (is_zero()) return copysign(0, sign_);
+ if (is_zero()) return std::copysign(0, sign_);
if (isinf(*this)) {
return std::copysign(std::numeric_limits<double>::infinity(), sign_);
}
@@ -248,7 +248,7 @@ double ExactFloat::ToDoubleHelper() const {
uint64_t d_mantissa = BN_ext_get_uint64(bn_.get());
// We rely on ldexp() to handle overflow and underflow. (It will return a
// signed zero or infinity if the result is too small or too large.)
- return sign_ * ldexp(static_cast<double>(d_mantissa), bn_exp_);
+ return sign_ * std::ldexp(static_cast<double>(d_mantissa), bn_exp_);
}
ExactFloat ExactFloat::RoundToMaxPrec(int max_prec, RoundingMode mode) const {
@@ -336,7 +336,7 @@ int ExactFloat::NumSignificantDigitsForPrec(int prec) {
//
// Since either of these bounds can be too large by 0, 1, or 2 digits, we
// stick with the simpler first bound.
- return static_cast<int>(1 + ceil(prec * (M_LN2 / M_LN10)));
+ return static_cast<int>(1 + std::ceil(prec * (M_LN2 / M_LN10)));
}
// Numbers are always formatted with at least this many significant digits.

View File

@@ -5,9 +5,11 @@ endif()
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO google/s2geometry
REF v0.11.1
SHA512 c500029c6e9cc412a29a8a74961688b0a504f60b1a7698ef84c0d0ae760e3c3f05e7068fb1154c9755d907f82e3bc09f8bf1d0ff629cbd3bad6e70169187dd37
REF v${VERSION}
SHA512 4ddfff2f44c0e98b2a110da57335fe119788f32e3924c8bdbe9afffbad5e037fdfe64f88f664b025a86134e17f14f6195107035b258fde06f946972f1f0456a8
HEAD_REF main
PATCHES
fix-msvc-build.patch
)
vcpkg_cmake_configure(

View File

@@ -1,6 +1,6 @@
{
"name": "s2geometry",
"version": "0.11.1",
"version": "0.13.1",
"description": "S2 is a library for spherical geometry that aims to have the same robustness, flexibility, and performance as the very best planar geometry libraries.",
"homepage": "https://s2geometry.io",
"license": "Apache-2.0",

View File

@@ -8741,7 +8741,7 @@
"port-version": 10
},
"s2geometry": {
"baseline": "0.11.1",
"baseline": "0.13.1",
"port-version": 0
},
"s2n": {

View File

@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "075153dd71960e6d2befa9a18ad1217d976e9168",
"version": "0.13.1",
"port-version": 0
},
{
"git-tree": "3fd94490409a17aef62732c674d5e12b4804fdd8",
"version": "0.11.1",