mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-11 07:12:02 +00:00
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
This commit is contained in:
parent
6816902a09
commit
4716b712b1
1 changed files with 2 additions and 8 deletions
|
@ -13,6 +13,7 @@
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
|
#include <cmath>
|
||||||
|
|
||||||
#include "doomdef.h"
|
#include "doomdef.h"
|
||||||
#include "doomstat.h"
|
#include "doomstat.h"
|
||||||
|
@ -42,13 +43,6 @@
|
||||||
#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)
|
||||||
|
@ -106,7 +100,7 @@ namespace swrenderer
|
||||||
v = v - floor(v);
|
v = v - floor(v);
|
||||||
double v_step = uv_stepd / texture->GetHeight();
|
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;
|
uv_stepd = 0.0;
|
||||||
v = 0.0;
|
v = 0.0;
|
||||||
|
|
Loading…
Reference in a new issue