rework langinfo code for ABI compat and for use by time code
[musl] / src / math / llrintl.c
index f1cc47e..3449f6f 100644 (file)
@@ -8,7 +8,7 @@ long long llrintl(long double x)
 {
        return llrint(x);
 }
-#else
+#elif defined(FE_INEXACT)
 /*
 see comments in lrint.c
 
@@ -18,6 +18,7 @@ raises inexact (with tonearest or upward rounding mode)
 */
 long long llrintl(long double x)
 {
+       #pragma STDC FENV_ACCESS ON
        int e;
 
        e = fetestexcept(FE_INEXACT);
@@ -27,4 +28,9 @@ long long llrintl(long double x)
        /* conversion */
        return x;
 }
+#else
+long long llrintl(long double x)
+{
+       return rintl(x);
+}
 #endif