Feature #1290: === Core: framework ===
Unify treatment of numeric constants.
|Status:||Resolved||Start date:||03 Aug 2016|
A constant is not a unit. Constants should be moved from Units.h to a new file Const.h. At a few places, we are using M_PI though we have our own PI etc. We should eliminate one of the two sets of constants. If we opt against M_PI, we can also remove _USE_MATH_DEFINES from SetUpWindows.cmake. We should define complex constants cone(1.,0.), cim(0.,1.), and possible zero(0.,0.).
#1 Updated by wuttke over 3 years ago
- Description updated (diff)
M_PI is used in several third-party sources. We do not want to patch them. Therefore we cannot get rid of M_PI. We rather need to rely on compiler settings that ensure that M_PI is defined.
Unfortunately, it turns out that those compiler settings are not sufficient to guarantee that M_PI_2 is defined as well.
Per commit ac1d8bb0, the solution is to define or redefine M_PI, M_PI_2 etc, just as they are defined in a section of math.h that is not normally activated.