summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Clock.c9
-rw-r--r--configure.ac4
2 files changed, 11 insertions, 2 deletions
diff --git a/Clock.c b/Clock.c
index 692dd5b..1a6f685 100644
--- a/Clock.c
+++ b/Clock.c
@@ -1734,7 +1734,14 @@ erase_hands(ClockWidget w, struct tm *tm)
static void
ClockAngle(double tick_units, double *sinp, double *cosp)
{
- sincos(tick_units * (M_PI / 180 / 10.0), sinp, cosp);
+ double angle = tick_units * (M_PI / 180 / 10.0);
+
+#ifdef HAVE_SINCOS
+ sincos(angle, sinp, cosp);
+#else
+ *sinp = sin(angle);
+ *cosp = cos(angle);
+#endif
}
/*
diff --git a/configure.ac b/configure.ac
index eb79e69..a310d50 100644
--- a/configure.ac
+++ b/configure.ac
@@ -53,7 +53,9 @@ if test x$use_xft != xno ; then
PKG_CHECK_MODULES(XFT, [xrender xft])
# Solaris 11 has sqrt in libc but needs libm for sincos
AC_SEARCH_LIBS(sqrt, [m])
- AC_SEARCH_LIBS(sincos, [m])
+ AC_SEARCH_LIBS(sincos, [m],
+ AC_DEFINE([HAVE_SINCOS], [1],
+ [Define to 1 if you have the `sincos' function.]))
XCLOCK_CFLAGS="$XCLOCK_CFLAGS $XFT_CFLAGS"
XCLOCK_LIBS="$XCLOCK_LIBS $XFT_LIBS"
AC_DEFINE([XRENDER],1,[Define to use X Render Extension])