diff --git a/src/Magnum/Math/Constants.h b/src/Magnum/Math/Constants.h index c51f7a2e6..d3f32c1a9 100644 --- a/src/Magnum/Math/Constants.h +++ b/src/Magnum/Math/Constants.h @@ -147,6 +147,17 @@ template struct Constants; #endif #ifndef DOXYGEN_GENERATING_OUTPUT +#ifndef CORRADE_TARGET_EMSCRIPTEN +template<> struct Constants { + /* Needed by Deg->Rad conversion, which is needed by a test for + __builtin_sincos. Hopefully nobody else needs those, so it's just pi. + 21-digit string representation gives back the same value on rountrip. + https://en.wikipedia.org/wiki/Extended_precision#Working_range + Value taken using Wolfram Alpha. 1.23456789012345678901 */ + static constexpr long double pi() { return 3.14159265358979323846l; } +}; +#endif + template<> struct Constants { Constants() = delete;