From 4716b712b1cd5983777247e7e125aeac3870717a Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Tue, 28 Mar 2017 17:10:06 +0300 Subject: [PATCH] Fixed compilation issues with isnan() Need to do it in pure C++ way to avoid C99 macro at all costs Tested with CI targets, on Debian Jessie using GCC 4.9 and on Ubuntu 16.04 using GCC 5.4 --- src/swrenderer/line/r_walldraw.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/swrenderer/line/r_walldraw.cpp b/src/swrenderer/line/r_walldraw.cpp index d315d5a01..f07a63bb8 100644 --- a/src/swrenderer/line/r_walldraw.cpp +++ b/src/swrenderer/line/r_walldraw.cpp @@ -13,6 +13,7 @@ #include #include +#include #include "doomdef.h" #include "doomstat.h" @@ -42,13 +43,6 @@ #include "swrenderer/r_renderthread.h" #include "swrenderer/r_memory.h" -#ifndef isnan -// Fallback to C++ function if C99 isnan() macro is not undefined -// Most likely it was undefined in C++ library header to avoid conflicts with own function -#include -using std::isnan; -#endif // !isnan - namespace swrenderer { WallSampler::WallSampler(RenderViewport *viewport, int y1, double texturemid, float swal, double yrepeat, fixed_t xoffset, double xmagnitude, FTexture *texture) @@ -106,7 +100,7 @@ namespace swrenderer v = v - floor(v); double v_step = uv_stepd / texture->GetHeight(); - if (isnan(v) || isnan(v_step)) // this should never happen, but it apparently does.. + if (std::isnan(v) || std::isnan(v_step)) // this should never happen, but it apparently does.. { uv_stepd = 0.0; v = 0.0;