Index: src/platform-posix.cc |
diff --git a/src/platform-posix.cc b/src/platform-posix.cc |
index 804b38bd5e8f38ac05b6adc1cfc8e992aecedc25..9bc3193631aab80a0b71e799259c2c35b1d19e65 100644 |
--- a/src/platform-posix.cc |
+++ b/src/platform-posix.cc |
@@ -225,6 +225,12 @@ void OS::DebugBreak() { |
// ---------------------------------------------------------------------------- |
// Math functions |
+double ceiling(double x) { |
+ // Correct buggy 'ceil' on some systems (i.e. FreeBSD, OS X 10.5) |
+ return (-1.0 < x && x < 0.0) ? -0.0 : ceil(x); |
+} |
+ |
+ |
double modulo(double x, double y) { |
return fmod(x, y); |
} |