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
This commit is contained in:
alexey.lysiuk 2017-03-27 15:09:01 +03:00
parent e865ba60f5
commit 020c34abfa

View file

@ -42,6 +42,13 @@
#include "swrenderer/r_renderthread.h" #include "swrenderer/r_renderthread.h"
#include "swrenderer/r_memory.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 <cmath>
using std::isnan;
#endif // !isnan
namespace swrenderer namespace swrenderer
{ {
WallSampler::WallSampler(RenderViewport *viewport, int y1, double texturemid, float swal, double yrepeat, fixed_t xoffset, double xmagnitude, FTexture *texture) WallSampler::WallSampler(RenderViewport *viewport, int y1, double texturemid, float swal, double yrepeat, fixed_t xoffset, double xmagnitude, FTexture *texture)