glib/glib/gnulib/frexpl.c
Chun-wei Fan a1fbeb3e4f build: Improve tests for frexpl() and ldexpl()
The test programs for those in the Meson build files will not work for
Visual Studio prior to 2013 (whereas the rest of the code does).
Improve the tests for these by:

-Adding a test to see whether we can re-define a prototype for these
 functions, using cc.compiles().  If so, set HAVE_DECL_xxxx to be 0,
 otherwise set HAVE_DECL_xxxx to be 1.

Also, for glib/gnulib/frexpl.c, don't undefine frexpl on Visual Studio,
otherwise we will not be able to compile/link it on Visual Studio
compilers.
2019-04-08 17:50:59 +08:00

22 lines
349 B
C

#include <config.h>
#include <gnulib_math.h>
#include <float.h>
#include <math.h>
long double rpl_frexpl (long double x, int *expptr)
{
if (x == 0.0L || x == -0.0L)
{
*expptr = x;
return x;
}
else if (isnanl (x))
return x;
else if (isinf (x))
return x;
#ifndef _MSC_VER
#undef frexpl
#endif
return frexpl (x, expptr);
}