Work around M_PIf name collision with glibc 2.34
authorTimo Röhling <roehling@debian.org>
Mon, 7 Feb 2022 09:12:38 +0000 (10:12 +0100)
committerTimo Röhling <roehling@debian.org>
Mon, 7 Feb 2022 09:12:38 +0000 (10:12 +0100)
debian/patches/0013-Define-M_PIf-only-if-it-is-not-already-defined-in-ma.patch [new file with mode: 0644]
debian/patches/series

diff --git a/debian/patches/0013-Define-M_PIf-only-if-it-is-not-already-defined-in-ma.patch b/debian/patches/0013-Define-M_PIf-only-if-it-is-not-already-defined-in-ma.patch
new file mode 100644 (file)
index 0000000..554a285
--- /dev/null
@@ -0,0 +1,22 @@
+From: =?utf-8?q?Timo_R=C3=B6hling?= <roehling@debian.org>
+Date: Mon, 7 Feb 2022 10:12:08 +0100
+Subject: Define M_PIf only if it is not already defined in math.h
+
+---
+ libs/image/src/ImageSampler.cpp | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/libs/image/src/ImageSampler.cpp b/libs/image/src/ImageSampler.cpp
+index 00385e9..53c68e8 100644
+--- a/libs/image/src/ImageSampler.cpp
++++ b/libs/image/src/ImageSampler.cpp
+@@ -38,7 +38,9 @@ struct FilterFunction {
+     bool rejectExternalSamples = true;
+ };
++#ifndef M_PIf
+ constexpr float M_PIf = float(filament::math::F_PI);
++#endif
+ const FilterFunction Box {
+     .fn = [](float t) { return t <= 0.5f ? 1.0f : 0.0f; },
index e18104fdf6899cbd9be03e09eedb1dd009f2ec67..62d7085bcd9d929b1f94c4e922eb94d7b0c85518 100644 (file)
@@ -10,3 +10,4 @@
 0010-Rename-resgen-executable-to-avoid-conflict-with-mono.patch
 0011-Replace-BlueGL-with-GLEW.patch
 0012-Use-system-spirv-cross.patch
+0013-Define-M_PIf-only-if-it-is-not-already-defined-in-ma.patch