X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-core%2Ftrunk%2Fsrc%2Fsynfig%2Ftime.cpp;h=fa799404a46904c186bf80546f96d2ff3035d420;hb=243072522bb877911a25499eacb20dcae016c2a9;hp=c4bff19dea09ff045309ae1a527a7a00d8da29af;hpb=e8a065f2385c219c511b57dac52786120bfa097d;p=synfig.git diff --git a/synfig-core/trunk/src/synfig/time.cpp b/synfig-core/trunk/src/synfig/time.cpp index c4bff19..fa79940 100644 --- a/synfig-core/trunk/src/synfig/time.cpp +++ b/synfig-core/trunk/src/synfig/time.cpp @@ -38,7 +38,6 @@ #include #include -#ifndef isnan #ifdef WIN32 #include @@ -48,12 +47,18 @@ extern "C" { int _isnan(double x); } #endif #endif -#ifdef __APPLE__ -#define isnan __isnanf +// For some reason isnan() isn't working on macosx any more. +// This is a quick fix. +#if defined(__APPLE__) && !defined(SYNFIG_ISNAN_FIX) +#ifdef isnan +#undef isnan #endif - +inline bool isnan(double x) { return x != x; } +inline bool isnan(float x) { return x != x; } +#define SYNFIG_ISNAN_FIX 1 #endif + #endif /* === U S I N G =========================================================== */ @@ -77,13 +82,13 @@ Time::Time(const String &str_, float fps): std::transform(str.begin(),str.end(),str.begin(),&tolower); // Start/Begin Of Time - if(str=="SOT" || str=="BOT") + if(str=="sot" || str=="bot") { operator=(begin()); return; } // End Of Time - if(str=="EOT") + if(str=="eot") { operator=(end()); return; @@ -93,7 +98,7 @@ Time::Time(const String &str_, float fps): unsigned int pos=0; int read; float amount; - + // Now try to read it in the letter-abreviated format while(pos=end()) return "EOT"; // End Of Time - + if(fps<0)fps=0; - + if(ceil(time.value_)-time.value_=epsilon_())) ret+=strprintf("%0.3ff",frame); else @@ -227,7 +232,7 @@ Time::get_string(float fps, Time::Format format)const else ret+=strprintf("%0.0fs",second); } - + return ret; }