File: 0003-Drop-constexpr-it-is-not-const-on-ppc64el.patch

package info (click to toggle)
s2geometry 0.10.0-6.1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 5,568 kB
  • sloc: cpp: 65,177; python: 763; makefile: 5
file content (59 lines) | stat: -rw-r--r-- 2,856 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
From: Jochen Sprickerhof <jspricke@debian.org>
Date: Tue, 15 Nov 2022 11:22:46 +0100
Subject: Drop constexpr, it is not const on ppc64el
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit

/<<PKGBUILDDIR>>/src/s2/s2edge_crossings.cc: In instantiation of ‘bool S2::internal::GetStableCrossProd(const Vector3<T>&, const Vector3<T>&, Vector3<T>*) [with T = long double]’:
/<<PKGBUILDDIR>>/src/s2/s2edge_crossings.cc:127:54:   required from here
/<<PKGBUILDDIR>>/src/s2/s2edge_crossings.cc:115:31: error: ‘(6.15348059642740421245081038903225e-15l / 5.40431955284459475358983848622456e+16l)’ is not a constant expression
  115 |       (32 * kSqrt3 * DBL_ERR) /
      |       ~~~~~~~~~~~~~~~~~~~~~~~~^
  116 |       (kRobustCrossProdError.radians() / T_ERR - (1 + 2 * kSqrt3));
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/<<PKGBUILDDIR>>/src/s2/s2edge_crossings.cc: In instantiation of ‘bool S2::GetIntersectionSimple(const Vector3<T>&, const Vector3<T>&, const Vector3<T>&, const Vector3<T>&, Vector3<T>*) [with T = long double]’:
/<<PKGBUILDDIR>>/src/s2/s2edge_crossings.cc:485:28:   required from here
/<<PKGBUILDDIR>>/src/s2/s2edge_crossings.cc:458:10: error: ‘(1.2e+1l / 7.20575940379279305358983848622456e+16l)’ is not a constant expression
  458 |       12 / (kIntersectionError.radians() / T_ERR - (2 + 2 * kSqrt3));
      |       ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

From:

https://buildd.debian.org/status/fetch.php?pkg=s2geometry&arch=ppc64el&ver=0.10.0-2&stamp=1667081576&raw=0

Reported upstream:

https://github.com/google/s2geometry/issues/279
---
 src/s2/s2edge_crossings.cc | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/s2/s2edge_crossings.cc b/src/s2/s2edge_crossings.cc
index 32289d7..9e98f55 100644
--- a/src/s2/s2edge_crossings.cc
+++ b/src/s2/s2edge_crossings.cc
@@ -111,7 +111,10 @@ inline bool GetStableCrossProd(const Vector3<T>& a, const Vector3<T>& b,
   // "a" and "b" are closer than about 18 * DBL_ERR == 9 * DBL_EPSILON.
   // (80-bit precision can handle inputs as close as 2.5 * LDBL_EPSILON.)
   constexpr T T_ERR = rounding_epsilon<T>();
-  constexpr T kMinNorm =
+#if ! __PPC64__
+constexpr
+#endif
+    T kMinNorm =
       (32 * kSqrt3 * DBL_ERR) /
       (kRobustCrossProdError.radians() / T_ERR - (1 + 2 * kSqrt3));
 
@@ -454,7 +457,10 @@ static bool GetIntersectionSimple(const Vector3<T>& a0, const Vector3<T>& a1,
 
   constexpr T T_ERR = rounding_epsilon<T>();
   constexpr T kMinNormalLength = (16 * kSqrt3 + 24) * DBL_ERR;
-  constexpr T kMinResultLen =
+#if ! __PPC64__
+  constexpr
+#endif
+    T kMinResultLen =
       12 / (kIntersectionError.radians() / T_ERR - (2 + 2 * kSqrt3));
 
   // On some platforms "long double" is the same as "double", and on these