From: darco Date: Wed, 28 Feb 2007 19:26:45 +0000 (+0000) Subject: A quick fix for the mysterious non working isnan on macosx builds. X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=7e6a1eb31322a853ebc47393a1f3dd6f124b6d33;p=synfig.git A quick fix for the mysterious non working isnan on macosx builds. git-svn-id: http://svn.voria.com/code@258 1f10aa63-cdf2-0310-b900-c93c546f37ac --- diff --git a/synfig-core/trunk/src/synfig/color.h b/synfig-core/trunk/src/synfig/color.h index c7b693d..2df724f 100644 --- a/synfig-core/trunk/src/synfig/color.h +++ b/synfig-core/trunk/src/synfig/color.h @@ -27,9 +27,6 @@ /* === H E A D E R S ======================================================= */ -#ifndef SYNFIG_NO_ANGLE -# include "angle.h" -#endif //#include #include @@ -41,9 +38,11 @@ #include #endif -/* === M A C R O S ========================================================= */ +#ifndef SYNFIG_NO_ANGLE +# include "angle.h" +#endif -#ifndef isnan +/* === M A C R O S ========================================================= */ #ifdef WIN32 #include @@ -53,10 +52,15 @@ 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 namespace synfig { diff --git a/synfig-core/trunk/src/synfig/time.cpp b/synfig-core/trunk/src/synfig/time.cpp index 946ac0b..837f7aa 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 =========================================================== */ diff --git a/synfig-core/trunk/src/synfig/vector.h b/synfig-core/trunk/src/synfig/vector.h index 2d71e78..80ff976 100644 --- a/synfig-core/trunk/src/synfig/vector.h +++ b/synfig-core/trunk/src/synfig/vector.h @@ -28,11 +28,10 @@ /* === H E A D E R S ======================================================= */ #include "real.h" -#include +#include /* === M A C R O S ========================================================= */ -#ifndef isnan #ifdef WIN32 #include @@ -42,12 +41,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 + /* === T Y P E D E F S ===================================================== */ /* === C L A S S E S & S T R U C T S ======================================= */