Prefer Port over #if-switching on the compiler.

The issue might have to be revisited (with proper testing)
for FreeBSD or ARM.
This commit is contained in:
David Nadlinger
2013-05-31 21:35:00 +02:00
parent ca3cd82805
commit 7e7af8c920

View File

@@ -488,10 +488,6 @@ Expression *Mod(Type *type, Expression *e1, Expression *e2)
c = Port::fmodl(e1->toReal(), r2) + Port::fmodl(e1->toImaginary(), r2) * I;
#elif defined(IN_GCC)
c = complex_t(e1->toReal() % r2, e1->toImaginary() % r2);
#elif (defined(__FreeBSD__) && __FreeBSD_version < 800000) || defined(__arm__) || defined(__thumb__)
// freebsd is kinda messed up. the STABLE branch doesn't support C99's fmodl !?!
// arm also doesn't like fmodl
c = complex_t(fmod(e1->toReal(), r2), fmod(e1->toImaginary(), r2));
#else
c = complex_t(Port::fmodl(e1->toReal(), r2), Port::fmodl(e1->toImaginary(), r2));
#endif
@@ -503,10 +499,6 @@ Expression *Mod(Type *type, Expression *e1, Expression *e2)
c = Port::fmodl(e1->toReal(), i2) + Port::fmodl(e1->toImaginary(), i2) * I;
#elif defined(IN_GCC)
c = complex_t(e1->toReal() % i2, e1->toImaginary() % i2);
#elif (defined(__FreeBSD__) && __FreeBSD_version < 800000) || defined(__arm__) || defined(__thumb__)
// freebsd is kinda messed up. the STABLE branch doesn't support C99's fmodl !?!
// arm also doesn't like fmodl
c = complex_t(fmod(e1->toReal(), i2), fmod(e1->toImaginary(), i2));
#else
c = complex_t(Port::fmodl(e1->toReal(), i2), Port::fmodl(e1->toImaginary(), i2));
#endif