From 8d95fc7b3ea04d99cf0016b8dc13c2740c75a380 Mon Sep 17 00:00:00 2001 From: Christian Kamm Date: Sun, 24 Aug 2008 16:59:08 +0200 Subject: [PATCH] Add isnan for __APPLE__ and darwin version ident for OSX. --- dmd/expression.c | 6 ++++++ dmd/mars.c | 8 +++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/dmd/expression.c b/dmd/expression.c index 44e1508c..add82813 100644 --- a/dmd/expression.c +++ b/dmd/expression.c @@ -25,6 +25,12 @@ extern "C" char * __cdecl __locale_decpoint; #endif #endif +#ifdef __APPLE__ +#ifndef isnan +int isnan(double); +#endif +#endif + #if IN_GCC // Issues with using -include total.h (defines integer_t) and then complex.h fails... #undef integer_t diff --git a/dmd/mars.c b/dmd/mars.c index 167b9246..ee6a5874 100644 --- a/dmd/mars.c +++ b/dmd/mars.c @@ -314,6 +314,8 @@ int main(int argc, char *argv[]) global.params.os = OSWindows; #elif linux global.params.os = OSLinux; +#elif __APPLY__ + global.params.os = OSMacOSX; #else #error #endif /* linux */ @@ -749,12 +751,16 @@ int main(int argc, char *argv[]) global.params.tt_os = "-pc-mingw32"; break; - case OSLinux: + case OSLinux: VersionCondition::addPredefinedGlobalIdent("linux"); VersionCondition::addPredefinedGlobalIdent("Posix"); global.params.tt_os = "-pc-linux-gnu"; break; + case OSMacOSX: + VersionCondition::addPredefinedGlobalIdent("darwin"); + global.params.tt_os = "-pc-darwin-gnu"; + default: assert(false && "Target OS not supported"); }