[gtk+] Check for existence of sincos



commit 17bc7aaefd0e1ab78b14f6d5430b7831b6af2b99
Author: Matthias Clasen <mclasen redhat com>
Date:   Wed Mar 4 06:30:13 2015 -0500

    Check for existence of sincos
    
    It apparently doesn't exist everywhere.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=745578

 configure.ac     |    2 +-
 tests/gtkgears.c |   11 +++++++++++
 2 files changed, 12 insertions(+), 1 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index d9ca018..ccbd350 100644
--- a/configure.ac
+++ b/configure.ac
@@ -826,7 +826,7 @@ AC_TYPE_UID_T
 
 # Check for round(), rint(), isnan(), isinf() and nearbyint()
 AC_CHECK_LIB(m,round,,)
-AC_CHECK_FUNCS(round rint nearbyint)
+AC_CHECK_FUNCS(round rint nearbyint sincos)
 AC_CHECK_DECLS([isnan, isinf], [], [], [[#include <math.h>]])
 
 # Checks for gdkspawn
diff --git a/tests/gtkgears.c b/tests/gtkgears.c
index dfe66c3..fe36bf4 100644
--- a/tests/gtkgears.c
+++ b/tests/gtkgears.c
@@ -36,6 +36,8 @@
  */
 
 #define _GNU_SOURCE
+#include "config.h"
+
 #include <math.h>
 #include <stdlib.h>
 #include <string.h>
@@ -47,6 +49,15 @@
 #define VERTICES_PER_TOOTH 34
 #define GEAR_VERTEX_STRIDE 6
 
+#ifndef HAVE_SINCOS
+static void
+sincos (double x, double *_sin, double *_cos)
+{
+  *_sin = sin (x);
+  *_cos = cos (x);
+}
+#endif
+
 /**
  * Struct describing the vertices in triangle strip
  */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]