mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-04-05 11:29:03 +02:00
Applied the FreeBSD patch from Ralith, closes ticket #95 , slightly changed but basically the same. Thanx Ralith :)
This commit is contained in:
@@ -487,6 +487,9 @@ Expression *Mod(Type *type, Expression *e1, Expression *e2)
|
||||
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 @@ Expression *Mod(Type *type, Expression *e1, Expression *e2)
|
||||
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
|
||||
|
||||
@@ -330,8 +330,10 @@ int main(int argc, char *argv[])
|
||||
global.params.os = OSLinux;
|
||||
#elif __APPLE__
|
||||
global.params.os = OSMacOSX;
|
||||
#elif __FreeBSD__
|
||||
global.params.os = OSFreeBSD;
|
||||
#else
|
||||
#error
|
||||
#error Unsupported OS
|
||||
#endif /* linux */
|
||||
|
||||
assert(global.params.os != OSinvalid);
|
||||
@@ -843,6 +845,11 @@ int main(int argc, char *argv[])
|
||||
global.params.tt_os = "-pc-darwin-gnu";
|
||||
break;
|
||||
|
||||
case OSFreeBSD:
|
||||
VersionCondition::addPredefinedGlobalIdent("freebsd");
|
||||
VersionCondition::addPredefinedGlobalIdent("Posix");
|
||||
break;
|
||||
|
||||
default:
|
||||
assert(false && "Target OS not supported");
|
||||
}
|
||||
|
||||
@@ -52,7 +52,8 @@ enum OS
|
||||
OSinvalid,
|
||||
OSLinux,
|
||||
OSWindows,
|
||||
OSMacOSX
|
||||
OSMacOSX,
|
||||
OSFreeBSD
|
||||
};
|
||||
|
||||
// Put command line switches in here
|
||||
|
||||
Reference in New Issue
Block a user