From 90bf583d2871b6496a68deca8ba8c8311cdb8c9a Mon Sep 17 00:00:00 2001 From: Jeremy Soller <jeremy@system76.com> Date: Sun, 9 Dec 2018 14:43:23 -0700 Subject: [PATCH] Better patch for missing M_PI constants --- include/math.h | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/include/math.h b/include/math.h index a0cd1d106..8063e8877 100644 --- a/include/math.h +++ b/include/math.h @@ -1,5 +1,14 @@ #include <openlibm_math.h> // Included to fix mesa issues -#define M_PI_2 (M_PI/2.0) -#define M_PI_4 (M_PI/4.0) +#ifndef M_PI +#define M_PI 3.14159265358979323846 /* pi */ +#endif + +#ifndef M_PI_2 +#define M_PI_2 1.57079632679489661923 /* pi/2 */ +#endif + +#ifndef M_PI_4 +#define M_PI_4 0.78539816339744830962 /* pi/4 */ +#endif -- GitLab