Rename mathematical constants such that they differ from macros in math.h
In src/core/math/Constants.h
, we (re-) define mathematical constants as constexpr
. Each constant is given the same name as in the preprocessor macros from the C-header math.h
(e.g. Pi is named M_PI
). We therefore have to #undefine
each constant's macro definition in src/core/math/Constants.h
.
However, this approach might (dependent on the order of the included header-files) fail at compile-time, once an included external library redefines an above mentioned macro.
For instance, this problem currently occurs when using the constant walberla::math::M_PI
while also including OpenMesh, which has #define M_PI
in its MathDefs.hh
header.
For this reason, we should rename the mathematical constants in src/core/math/Constants.h
such that they do not coincide with the names of macros in math.h
.