From 35f3704099902b2b23ee927e893772f77a51cce8 Mon Sep 17 00:00:00 2001 From: Giovanni Bussi <giovanni.bussi@gmail.com> Date: Tue, 20 Feb 2018 19:50:57 +0100 Subject: [PATCH] Fixed M_PI With some compiler it is undefined. Notice that it is not in the c++ standard. --- src/isdb/Metainference.cpp | 4 ++++ src/isdb/MetainferenceBase.cpp | 4 ++++ src/isdb/SAXS.cpp | 4 ++++ src/lepton/Operation.cpp | 4 ++++ 4 files changed, 16 insertions(+) diff --git a/src/isdb/Metainference.cpp b/src/isdb/Metainference.cpp index 2536c0f50..2fa25f156 100644 --- a/src/isdb/Metainference.cpp +++ b/src/isdb/Metainference.cpp @@ -33,6 +33,10 @@ #include <numeric> using namespace std; +#ifndef M_PI +#define M_PI 3.14159265358979323846 +#endif + namespace PLMD { namespace isdb { diff --git a/src/isdb/MetainferenceBase.cpp b/src/isdb/MetainferenceBase.cpp index 381fa96b3..1a44e712e 100644 --- a/src/isdb/MetainferenceBase.cpp +++ b/src/isdb/MetainferenceBase.cpp @@ -27,6 +27,10 @@ using namespace std; +#ifndef M_PI +#define M_PI 3.14159265358979323846 +#endif + namespace PLMD { namespace isdb { diff --git a/src/isdb/SAXS.cpp b/src/isdb/SAXS.cpp index 2e965236b..990e0973d 100644 --- a/src/isdb/SAXS.cpp +++ b/src/isdb/SAXS.cpp @@ -35,6 +35,10 @@ #include <cmath> #include <map> +#ifndef M_PI +#define M_PI 3.14159265358979323846 +#endif + using namespace std; namespace PLMD { diff --git a/src/lepton/Operation.cpp b/src/lepton/Operation.cpp index f16fd7b41..0d47f0627 100644 --- a/src/lepton/Operation.cpp +++ b/src/lepton/Operation.cpp @@ -66,6 +66,10 @@ #include "ExpressionTreeNode.h" #include "MSVC_erfc.h" +#ifndef M_PI +#define M_PI 3.14159265358979323846 +#endif + namespace PLMD { using namespace lepton; using namespace std; -- GitLab