mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-04-05 11:29:03 +02:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user