Fix Windows build, again.
This commit is contained in:
parent
cb32e3d8f9
commit
c64edf31fc
@ -35,6 +35,7 @@
|
||||
#include "common_logic.h"
|
||||
#include "MersenneTwister.h"
|
||||
#include <IPluginSys.h>
|
||||
#include <am-utility.h>
|
||||
|
||||
/****************************************
|
||||
* *
|
||||
@ -119,7 +120,7 @@ static cell_t sm_FloatNe(IPluginContext *pCtx, const cell_t *params)
|
||||
static cell_t sm_FloatNot(IPluginContext *pCtx, const cell_t *params)
|
||||
{
|
||||
float val = sp_ctof(params[1]);
|
||||
if (isnan(val))
|
||||
if (ke::IsNaN(val))
|
||||
return 1;
|
||||
return val ? 0 : 1;
|
||||
}
|
||||
|
@ -33,12 +33,12 @@
|
||||
#include <ctype.h>
|
||||
#include <stdarg.h>
|
||||
#include <ITextParsers.h>
|
||||
#include <float.h>
|
||||
#include "sm_stringutil.h"
|
||||
#include "Logger.h"
|
||||
#include "PlayerManager.h"
|
||||
#include "logic_bridge.h"
|
||||
#include "sourcemod.h"
|
||||
#include <am-utility.h>
|
||||
|
||||
#define LADJUST 0x00000004 /* left adjustment */
|
||||
#define ZEROPAD 0x00000080 /* zero (as opposed to blank) pad */
|
||||
@ -214,7 +214,8 @@ void AddFloat(char **buf_p, size_t &maxlen, double fval, int width, int prec, in
|
||||
int significant_digits = 0; // number of significant digits written
|
||||
const int MAX_SIGNIFICANT_DIGITS = 16;
|
||||
|
||||
if (isnan(fval)) {
|
||||
if (ke::IsNaN(fval))
|
||||
{
|
||||
AddString(buf_p, maxlen, "NaN", width, prec);
|
||||
return;
|
||||
}
|
||||
|
@ -34,6 +34,8 @@
|
||||
#include <stddef.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
#include <math.h>
|
||||
#include <float.h>
|
||||
#if defined(_MSC_VER)
|
||||
# include <intrin.h>
|
||||
#endif
|
||||
@ -218,6 +220,16 @@ FindRightmostBit(size_t number)
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline bool
|
||||
IsNaN(double v)
|
||||
{
|
||||
#ifdef _MSC_VER
|
||||
return _isnan(v);
|
||||
#else
|
||||
return isnan(v);
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline bool
|
||||
IsPowerOfTwo(size_t value)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user