From 020c34abfa17e78c085deea6027bd1cdbf1d1481 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Mon, 27 Mar 2017 15:09:01 +0300 Subject: [PATCH] Added workaround for undefined isnan() All our continuous integration targets have no problems with C99 isnan() macro but on Ubuntu 16.04 compilation fails It appeared that some implementation of C++ Standard Library may undefine bunch of C macros to avoid conflicts with own declarations --- src/swrenderer/line/r_walldraw.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/swrenderer/line/r_walldraw.cpp b/src/swrenderer/line/r_walldraw.cpp index bf8d856e9..d315d5a01 100644 --- a/src/swrenderer/line/r_walldraw.cpp +++ b/src/swrenderer/line/r_walldraw.cpp @@ -42,6 +42,13 @@ #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)