diff dmd/constfold.c @ 637:29dc68c949b0

Applied the FreeBSD patch from Ralith, closes ticket #95 , slightly changed but basically the same. Thanx Ralith :)
author Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
date Thu, 02 Oct 2008 03:25:46 +0200
parents aaade6ded589
children 50383e476c7e
line wrap: on
line diff
--- a/dmd/constfold.c	Thu Oct 02 01:42:21 2008 +0200
+++ b/dmd/constfold.c	Thu Oct 02 03:25:46 2008 +0200
@@ -487,6 +487,9 @@
 	    c = fmodl(e1->toReal(), r2) + fmodl(e1->toImaginary(), r2) * I;
 #elif defined(IN_GCC)
 	    c = complex_t(e1->toReal() % r2, e1->toImaginary() % r2);
+#elif defined(__FreeBSD__) && __FreeBSD_version < 800000
+        // freebsd is kinda messed up. the STABLE branch doesn't support C99's fmodl !?!
+        c = complex_t(fmod(e1->toReal(), r2), fmod(e1->toImaginary(), r2));
 #else
 	    c = complex_t(fmodl(e1->toReal(), r2), fmodl(e1->toImaginary(), r2));
 #endif
@@ -498,6 +501,9 @@
 	    c = fmodl(e1->toReal(), i2) + fmodl(e1->toImaginary(), i2) * I;
 #elif defined(IN_GCC)
 	    c = complex_t(e1->toReal() % i2, e1->toImaginary() % i2);
+#elif defined(__FreeBSD__) && __FreeBSD_version < 800000
+        // freebsd is kinda messed up. the STABLE branch doesn't support C99's fmodl !?!
+        c = complex_t(fmod(e1->toReal(), i2), fmod(e1->toImaginary(), i2));
 #else
 	    c = complex_t(fmodl(e1->toReal(), i2), fmodl(e1->toImaginary(), i2));
 #endif