math: use '#pragma STDC FENV_ACCESS ON' when fenv is accessed
[musl] / src / math / lrintl.c
index 0e579bc..b2a8106 100644 (file)
@@ -8,7 +8,7 @@ long lrintl(long double x)
 {
        return lrint(x);
 }
-#else
+#elif defined(FE_INEXACT)
 /*
 see comments in lrint.c
 
@@ -18,6 +18,7 @@ raises inexact (with tonearest or upward rounding mode)
 */
 long lrintl(long double x)
 {
+       #pragma STDC FENV_ACCESS ON
        int e;
 
        e = fetestexcept(FE_INEXACT);
@@ -27,4 +28,9 @@ long lrintl(long double x)
        /* conversion */
        return x;
 }
+#else
+long lrintl(long double x)
+{
+       return rintl(x);
+}
 #endif