diff options
author | Chun-wei Fan <fanchunwei@src.gnome.org> | 2014-12-02 15:57:17 +0800 |
---|---|---|
committer | Chun-wei Fan <fanchunwei@src.gnome.org> | 2014-12-03 17:10:37 +0800 |
commit | fbe4f94519e6aedfcb296ddfa7d9c5564791e4b1 (patch) | |
tree | baf646dd2caabca363f6a09b2fec603f3d53ed05 /tests/gtkgears.c | |
parent | 7717b0d556e623256cabfa0e83b41511bb21cb3b (diff) | |
download | gtk+-fbe4f94519e6aedfcb296ddfa7d9c5564791e4b1.tar.gz |
test/gtkgears.c: Fix Builds on Systems Without M_PI
Use G_PI in place of M_PI to fix the build on compilers that do not have
M_PI defined.
https://bugzilla.gnome.org/show_bug.cgi?id=740795
Diffstat (limited to 'tests/gtkgears.c')
-rw-r--r-- | tests/gtkgears.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/tests/gtkgears.c b/tests/gtkgears.c index 297967184b..11e0ac8874 100644 --- a/tests/gtkgears.c +++ b/tests/gtkgears.c @@ -126,7 +126,7 @@ gear(GLfloat inner_radius, GLfloat outer_radius, GLfloat width, /* draw front face */ glBegin(GL_QUAD_STRIP); for (i = 0; i <= teeth; i++) { - angle = i * 2.0 * M_PI / teeth; + angle = i * 2.0 * G_PI / teeth; glVertex3f(r0 * cos(angle), r0 * sin(angle), width * 0.5); glVertex3f(r1 * cos(angle), r1 * sin(angle), width * 0.5); if (i < teeth) { @@ -139,9 +139,9 @@ gear(GLfloat inner_radius, GLfloat outer_radius, GLfloat width, /* draw front sides of teeth */ glBegin(GL_QUADS); - da = 2.0 * M_PI / teeth / 4.0; + da = 2.0 * G_PI / teeth / 4.0; for (i = 0; i < teeth; i++) { - angle = i * 2.0 * M_PI / teeth; + angle = i * 2.0 * G_PI / teeth; glVertex3f(r1 * cos(angle), r1 * sin(angle), width * 0.5); glVertex3f(r2 * cos(angle + da), r2 * sin(angle + da), width * 0.5); @@ -157,7 +157,7 @@ gear(GLfloat inner_radius, GLfloat outer_radius, GLfloat width, /* draw back face */ glBegin(GL_QUAD_STRIP); for (i = 0; i <= teeth; i++) { - angle = i * 2.0 * M_PI / teeth; + angle = i * 2.0 * G_PI / teeth; glVertex3f(r1 * cos(angle), r1 * sin(angle), -width * 0.5); glVertex3f(r0 * cos(angle), r0 * sin(angle), -width * 0.5); if (i < teeth) { @@ -170,9 +170,9 @@ gear(GLfloat inner_radius, GLfloat outer_radius, GLfloat width, /* draw back sides of teeth */ glBegin(GL_QUADS); - da = 2.0 * M_PI / teeth / 4.0; + da = 2.0 * G_PI / teeth / 4.0; for (i = 0; i < teeth; i++) { - angle = i * 2.0 * M_PI / teeth; + angle = i * 2.0 * G_PI / teeth; glVertex3f(r1 * cos(angle + 3 * da), r1 * sin(angle + 3 * da), -width * 0.5); @@ -186,7 +186,7 @@ gear(GLfloat inner_radius, GLfloat outer_radius, GLfloat width, /* draw outward faces of teeth */ glBegin(GL_QUAD_STRIP); for (i = 0; i < teeth; i++) { - angle = i * 2.0 * M_PI / teeth; + angle = i * 2.0 * G_PI / teeth; glVertex3f(r1 * cos(angle), r1 * sin(angle), width * 0.5); glVertex3f(r1 * cos(angle), r1 * sin(angle), -width * 0.5); @@ -223,7 +223,7 @@ gear(GLfloat inner_radius, GLfloat outer_radius, GLfloat width, /* draw inside radius cylinder */ glBegin(GL_QUAD_STRIP); for (i = 0; i <= teeth; i++) { - angle = i * 2.0 * M_PI / teeth; + angle = i * 2.0 * G_PI / teeth; glNormal3f(-cos(angle), -sin(angle), 0.0); glVertex3f(r0 * cos(angle), r0 * sin(angle), -width * 0.5); glVertex3f(r0 * cos(angle), r0 * sin(angle), width * 0.5); |