summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorNeil Roberts <neil@linux.intel.com>2013-04-05 18:08:29 +0100
committerNeil Roberts <neil@linux.intel.com>2013-04-23 17:46:55 +0100
commiteb5c92952e1882c95cfd6debc69a2c9efff096b9 (patch)
treeae2c6900f0cecb46e96bcf1d50026a578961896b /examples
parente3cc008e7a26af462871448561e4cde0f95bfdf9 (diff)
downloadcogl-eb5c92952e1882c95cfd6debc69a2c9efff096b9.tar.gz
Fix a warning about ‘sincos’ in examples/cogl-gles2-gears
‘sincos’ is a GNU extension. cogl-gles2-gears was using it without defining _GNU_SOURCE so it was generating some annoying warnings. This patch fixes it by making the example include config.h which will end up defining _GNU_SOURCE. In addition this patch adds a configure check for the function and provides a fallback if it's not available. https://bugzilla.gnome.org/show_bug.cgi?id=697330 Reviewed-by: Robert Bragg <robert@linux.intel.com>
Diffstat (limited to 'examples')
-rw-r--r--examples/cogl-gles2-gears.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/examples/cogl-gles2-gears.c b/examples/cogl-gles2-gears.c
index d7dd2716..c7185b67 100644
--- a/examples/cogl-gles2-gears.c
+++ b/examples/cogl-gles2-gears.c
@@ -35,6 +35,10 @@
* Jul 13, 2010
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#define GL_GLEXT_PROTOTYPES
#include <math.h>
@@ -110,6 +114,15 @@ static GLfloat ProjectionMatrix[16];
/** The direction of the directional light for the scene */
static const GLfloat LightSourcePosition[4] = { 5.0, 5.0, 10.0, 1.0};
+#ifndef HAVE_SINCOS
+static void
+sincos (double x, double *sinx, double *cosx)
+{
+ *sinx = sin (x);
+ *cosx = cos (x);
+}
+#endif /* HAVE_SINCOS */
+
/**
* Fills a gear vertex.
*