From 85d474f06a50cd764a51f7d07358b60f24c3077d Mon Sep 17 00:00:00 2001 From: Alastair Murray Date: Fri, 2 Aug 2019 17:46:16 +0100 Subject: [PATCH] Reintroduce M_PI compatibility M_PI is not part of C99 or C++ and thus aren't provided in all configurations. This used to be handled in reference_math.c directly but was recently removed. Just tweak the M_PI handling in the compatibility headers to restore builds. --- test_common/harness/compat.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test_common/harness/compat.h b/test_common/harness/compat.h index dc8468ff..660ed049 100644 --- a/test_common/harness/compat.h +++ b/test_common/harness/compat.h @@ -117,16 +117,16 @@ typedef long long int64_t; #include #endif +#ifndef M_PI + #define M_PI 3.14159265358979323846264338327950288 +#endif + #if defined( _MSC_VER ) #ifdef __cplusplus extern "C" { #endif - #ifndef M_PI - #define M_PI 3.14159265358979323846264338327950288 - #endif - #ifndef NAN #define NAN (INFINITY - INFINITY) #endif