#include "libgfortran.h"
-#if defined (HAVE_GFC_REAL_16) && defined (HAVE_FREXPL)
+
+#if defined(GFC_REAL_16_IS_FLOAT128)
+#define MATHFUNC(funcname) funcname ## q
+#else
+#define MATHFUNC(funcname) funcname ## l
+#endif
+
+#if defined (HAVE_GFC_REAL_16) && (defined(GFC_WITH_QUAD_LIB) || defined(HAVE_FREXPL))
extern GFC_INTEGER_4 exponent_r16 (GFC_REAL_16 s);
export_proto(exponent_r16);
exponent_r16 (GFC_REAL_16 s)
{
int ret;
- frexpl (s, &ret);
+ MATHFUNC(frexp) (s, &ret);
return ret;
}