summaryrefslogtreecommitdiff
path: root/Clock.c
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2022-04-04 16:51:04 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2022-04-04 16:51:04 -0700
commit96934f4472f10a1e5fcf53f6cbb9c88d743fa520 (patch)
tree5eb22b4e625d3dcfdc1eb4cfef0dc7b4758b405b /Clock.c
parent7126b722a055545d25291cd10076f4c3fe52f039 (diff)
Fall back to sin() and cos() calls on systems without sincos()
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Diffstat (limited to 'Clock.c')
-rw-r--r--Clock.c9
1 files changed, 8 insertions, 1 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
}
/*