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.
This commit is contained in:
Chun-wei Fan 2020-01-08 17:05:44 +08:00
parent ea810f176b
commit a9b1d4a389
2 changed files with 10 additions and 1 deletions

View File

@ -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
}
}

View File

@ -198,6 +198,7 @@ check_functions = [
'log2',
'exp2',
'sincos',
'sincosf',
]
foreach func : check_functions