diff options
author | Chun-wei Fan <fanchunwei@src.gnome.org> | 2020-01-08 17:05:44 +0800 |
---|---|---|
committer | Chun-wei Fan <fanchunwei@src.gnome.org> | 2020-01-08 17:15:29 +0800 |
commit | a9b1d4a38979278d8ffb6c4c9e2161c7b67fe93d (patch) | |
tree | 8f9289fde5bc8686bffdee16ed908719c938a411 /gsk/gsktransform.c | |
parent | ea810f176be50471a8f5b5a798aa551ef96bc717 (diff) | |
download | gtk+-a9b1d4a38979278d8ffb6c4c9e2161c7b67fe93d.tar.gz |
build: Check for sincosf()
sincosf() is really a GCC-specific function that may more may not be
supported on non-GCC compilers, so we want to check for it, otherwise we
use a fallback implementation, not unlike the one in
demos/gtk-demo/gtkgears.c.
Diffstat (limited to 'gsk/gsktransform.c')
-rw-r--r-- | gsk/gsktransform.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/gsk/gsktransform.c b/gsk/gsktransform.c index 3f944db9ea..388dad5b45 100644 --- a/gsk/gsktransform.c +++ b/gsk/gsktransform.c @@ -712,7 +712,15 @@ _sincos (float deg, } else { - sincosf (deg * M_PI / 180.0, out_s, out_c); + float angle = deg * M_PI / 180.0; + +#ifdef HAVE_SINCOSF + sincosf (angle, out_s, out_c); +#else + *out_s = sinf (angle); + *out_c = cosf (angle); +#endif + } } |