Mesa (mesa_7_6_branch): Fix building of GLSL demos which use M_PI

Brian Paul brianp at kemper.freedesktop.org
Mon Oct 5 17:09:10 UTC 2009


Module: Mesa
Branch: mesa_7_6_branch
Commit: a15d9ca9ccfeebfcea148fc61ead3a70541e2a76
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=a15d9ca9ccfeebfcea148fc61ead3a70541e2a76

Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date:   Fri Jul 24 20:33:25 2009 +0100

Fix building of GLSL demos which use M_PI

Some <math.h> files do not define M_PI, in which case, provide our own definition

Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>

---

 progs/glsl/skinning.c  |    3 +++
 progs/glsl/texaaline.c |    3 +++
 progs/glsl/twoside.c   |    3 +++
 3 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/progs/glsl/skinning.c b/progs/glsl/skinning.c
index 65ba983..2b96f31 100644
--- a/progs/glsl/skinning.c
+++ b/progs/glsl/skinning.c
@@ -16,6 +16,9 @@
 #include <GL/glut.h>
 #include "shaderutil.h"
 
+#ifndef M_PI
+#define M_PI 3.1415926535
+#endif
 
 static char *FragProgFile = "skinning.frag";
 static char *VertProgFile = "skinning.vert";
diff --git a/progs/glsl/texaaline.c b/progs/glsl/texaaline.c
index 7a5ac40..2e4f932 100644
--- a/progs/glsl/texaaline.c
+++ b/progs/glsl/texaaline.c
@@ -14,6 +14,9 @@
 #include <GL/glew.h>
 #include <GL/glut.h>
 
+#ifndef M_PI
+#define M_PI 3.1415926535
+#endif
 
 static GLint WinWidth = 300, WinHeight = 300;
 static GLint win = 0;
diff --git a/progs/glsl/twoside.c b/progs/glsl/twoside.c
index a57484f..ce155d6 100644
--- a/progs/glsl/twoside.c
+++ b/progs/glsl/twoside.c
@@ -16,6 +16,9 @@
 #include <GL/glut.h>
 #include "shaderutil.h"
 
+#ifndef M_PI
+#define M_PI 3.1415926535
+#endif
 
 static GLint WinWidth = 300, WinHeight = 300;
 static char *FragProgFile = NULL;




More information about the mesa-commit mailing list