From c1ef993f5e85bb1401834a85b506e4694a32adce Mon Sep 17 00:00:00 2001 From: Alastair Murray Date: Fri, 2 Aug 2019 17:22:07 +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 1ec8c7d1..6b1517b5 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