summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdlib/ldiv.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/stdlib/ldiv.c')
-rw-r--r--lib/libc/stdlib/ldiv.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/libc/stdlib/ldiv.c b/lib/libc/stdlib/ldiv.c
index 0ec98e6..745c566 100644
--- a/lib/libc/stdlib/ldiv.c
+++ b/lib/libc/stdlib/ldiv.c
@@ -48,9 +48,11 @@ ldiv(num, denom)
r.quot = num / denom;
r.rem = num % denom;
+#if !defined(__STDC_VERSION__) || (__STDC_VERSION__ < 199901L)
if (num >= 0 && r.rem < 0) {
r.quot++;
r.rem -= denom;
}
+#endif
return (r);
}
OpenPOWER on IntegriCloud