Define M_PIf only if it is not already defined in math.h
authorTimo Röhling <roehling@debian.org>
Mon, 7 Feb 2022 09:12:08 +0000 (10:12 +0100)
committerTimo Röhling <roehling@debian.org>
Sat, 12 Nov 2022 12:20:14 +0000 (12:20 +0000)
Gbp-Pq: Name 0013-Define-M_PIf-only-if-it-is-not-already-defined-in-ma.patch

libs/image/src/ImageSampler.cpp

index 00385e9323163c583ef5a459f3a4543e8eb68f15..53c68e8f1289f8b605e5f17ff3210b3cf4dbcdc8 100644 (file)
@@ -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; },