From 8010f5d05149424c2572121b48fdd0796051f901 Mon Sep 17 00:00:00 2001 From: Darryl Pogue Date: Sun, 8 Feb 2015 23:20:37 -0800 Subject: [PATCH] MinGW fix for plGLight isnan usage. --- .../PubUtilLib/plGLight/plPerspDirSlave.cpp | 16 ++++++---------- .../Plasma/PubUtilLib/plGLight/plShadowSlave.cpp | 10 +++------- 2 files changed, 9 insertions(+), 17 deletions(-) diff --git a/Sources/Plasma/PubUtilLib/plGLight/plPerspDirSlave.cpp b/Sources/Plasma/PubUtilLib/plGLight/plPerspDirSlave.cpp index 8fff1ee6..04ee1257 100644 --- a/Sources/Plasma/PubUtilLib/plGLight/plPerspDirSlave.cpp +++ b/Sources/Plasma/PubUtilLib/plGLight/plPerspDirSlave.cpp @@ -50,10 +50,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include #include -#ifdef HS_BUILD_FOR_WIN32 -#define isnan _isnan -#endif - void plPerspDirSlave::Init() { plShadowSlave::Init(); @@ -187,10 +183,10 @@ bool plPerspDirSlave::SetupViewTransform(plPipeline* pipe) // This is my hack to get the Nexus age working. The real problem // is probably data-side. I take full responsibility for this // hack-around breaking the entire system, loosing data, causing - // unauthorized credit card transactions, etc. - if (isnan(bnd.GetMins().fX) || isnan(bnd.GetMins().fY)) + // unauthorized credit card transactions, etc. + if (std::isnan(bnd.GetMins().fX) || std::isnan(bnd.GetMins().fY)) return false; - if (isnan(bnd.GetMaxs().fX) || isnan(bnd.GetMaxs().fY)) + if (std::isnan(bnd.GetMaxs().fX) || std::isnan(bnd.GetMaxs().fY)) return false; // THIS IS EVEN MORE WRONG @@ -248,10 +244,10 @@ bool plPerspDirSlave::SetupViewTransform(plPipeline* pipe) // This is my hack to get the Nexus age working. The real problem // is probably data-side. I take full responsibility for this // hack-around breaking the entire system, loosing data, causing - // unauthorized credit card transactions, etc. - if (isnan(bnd.GetMins().fX) || isnan(bnd.GetMins().fY)) + // unauthorized credit card transactions, etc. + if (std::isnan(bnd.GetMins().fX) || std::isnan(bnd.GetMins().fY)) return false; - if (isnan(bnd.GetMaxs().fX) || isnan(bnd.GetMaxs().fY)) + if (std::isnan(bnd.GetMaxs().fX) || std::isnan(bnd.GetMaxs().fY)) return false; plConst(float) kMinMinZ(1.f); diff --git a/Sources/Plasma/PubUtilLib/plGLight/plShadowSlave.cpp b/Sources/Plasma/PubUtilLib/plGLight/plShadowSlave.cpp index bf95e40d..6e9123d9 100644 --- a/Sources/Plasma/PubUtilLib/plGLight/plShadowSlave.cpp +++ b/Sources/Plasma/PubUtilLib/plGLight/plShadowSlave.cpp @@ -48,10 +48,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include #include -#ifdef HS_BUILD_FOR_WIN32 -#define isnan _isnan -#endif - static const float kMinMinZ = 1.f; // totally random arbitrary number (has to be > 0). bool plShadowSlave::ISetupOrthoViewTransform() @@ -136,10 +132,10 @@ bool plShadowSlave::ISetupPerspViewTransform() // This is my hack to get the Nexus age working. The real problem // is probably data-side. I take full responsibility for this // hack-around breaking the entire system, loosing data, causing - // unauthorized credit card transactions, etc. - if (isnan(bnd.GetMins().fX) || isnan(bnd.GetMins().fY)) + // unauthorized credit card transactions, etc. + if (std::isnan(bnd.GetMins().fX) || std::isnan(bnd.GetMins().fY)) return false; - if (isnan(bnd.GetMaxs().fX) || isnan(bnd.GetMaxs().fY)) + if (std::isnan(bnd.GetMaxs().fX) || std::isnan(bnd.GetMaxs().fY)) return false; float cotX, cotY;