Fix compilation with gcc
parent
8632c7404d
commit
789c8b2292
|
@ -23,6 +23,8 @@
|
|||
|
||||
#include "CBot/CBotVar/CBotVar.h"
|
||||
|
||||
#include <cmath>
|
||||
|
||||
namespace CBot
|
||||
{
|
||||
|
||||
|
@ -43,7 +45,7 @@ bool CBotExprLitNan::Execute(CBotStack* &pj)
|
|||
if (pile->IfStep()) return false;
|
||||
CBotVar* var = CBotVar::Create("", CBotTypFloat);
|
||||
|
||||
var->SetValFloat(std::nanf(""));
|
||||
var->SetValFloat(nanf(""));
|
||||
pile->SetVar(var); // put on the stack
|
||||
return pj->Return(pile); // forward below
|
||||
}
|
||||
|
|
|
@ -38,6 +38,8 @@
|
|||
|
||||
#include "CBot/CBotCStack.h"
|
||||
|
||||
#include <cmath>
|
||||
|
||||
namespace CBot
|
||||
{
|
||||
|
||||
|
@ -218,7 +220,7 @@ CBotInstr* CBotParExpr::CompileLitExpr(CBotToken* &p, CBotCStack* pStack)
|
|||
CBotInstr* inst = new CBotExprLitNan();
|
||||
inst->SetToken(pp);
|
||||
CBotVar* var = CBotVar::Create("", CBotTypFloat);
|
||||
var->SetValFloat(std::nanf(""));
|
||||
var->SetValFloat(nanf(""));
|
||||
pStk->SetVar(var);
|
||||
return pStack->Return(inst, pStk);
|
||||
}
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
#include "CBot/CBotVar/CBotVar.h"
|
||||
|
||||
#include <cassert>
|
||||
#include <cmath>
|
||||
#include <algorithm>
|
||||
|
||||
namespace CBot
|
||||
|
|
|
@ -112,6 +112,7 @@
|
|||
#include <algorithm>
|
||||
#include <iomanip>
|
||||
#include <stdexcept>
|
||||
#include <cmath>
|
||||
#include <ctime>
|
||||
|
||||
#include <boost/lexical_cast.hpp>
|
||||
|
@ -4155,7 +4156,7 @@ bool CRobotMain::FreeSpace(Math::Vector ¢er, float minRadius, float maxRadiu
|
|||
}
|
||||
}
|
||||
|
||||
float nan = std::nanf("");
|
||||
float nan = nanf("");
|
||||
|
||||
center = Math::Vector{ nan, nan, nan };
|
||||
|
||||
|
|
|
@ -100,7 +100,7 @@ float HaltToFloat(uint16_t value)
|
|||
// NaN
|
||||
else if ((exponent == 31) && (mantissa != 0))
|
||||
{
|
||||
result = std::nanf("");
|
||||
result = nanf("");
|
||||
}
|
||||
// Normal number
|
||||
else
|
||||
|
|
|
@ -67,6 +67,8 @@
|
|||
|
||||
#include "ui/displaytext.h"
|
||||
|
||||
#include <cmath>
|
||||
|
||||
using namespace CBot;
|
||||
|
||||
CBotTypResult CScriptFunctions::cClassNull(CBotVar* thisclass, CBotVar* &var)
|
||||
|
@ -2325,7 +2327,7 @@ bool CScriptFunctions::rReceive(CBotVar* var, CBotVar* result, int& exception, v
|
|||
if ( err != ERR_OK )
|
||||
{
|
||||
script->m_taskExecutor->StopForegroundTask();
|
||||
result->SetValFloat(std::nanf(""));
|
||||
result->SetValFloat(nanf(""));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -2336,7 +2338,7 @@ bool CScriptFunctions::rReceive(CBotVar* var, CBotVar* result, int& exception, v
|
|||
|
||||
if ( script->m_returnValue == boost::none )
|
||||
{
|
||||
result->SetValFloat(std::nanf(""));
|
||||
result->SetValFloat(nanf(""));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -3657,11 +3659,11 @@ void CScriptFunctions::uObject(CBotVar* botThis, void* user)
|
|||
if (IsObjectBeingTransported(object))
|
||||
{
|
||||
pSub = pVar->GetItemList(); // "x"
|
||||
pSub->SetValFloat(std::nanf(""));
|
||||
pSub->SetValFloat(nanf(""));
|
||||
pSub = pSub->GetNext(); // "y"
|
||||
pSub->SetValFloat(std::nanf(""));
|
||||
pSub->SetValFloat(nanf(""));
|
||||
pSub = pSub->GetNext(); // "z"
|
||||
pSub->SetValFloat(std::nanf(""));
|
||||
pSub->SetValFloat(nanf(""));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -3762,11 +3764,11 @@ void CScriptFunctions::uObject(CBotVar* botThis, void* user)
|
|||
if (IsObjectBeingTransported(object) || physics == nullptr)
|
||||
{
|
||||
pSub = pVar->GetItemList(); // "x"
|
||||
pSub->SetValFloat(std::nanf(""));
|
||||
pSub->SetValFloat(nanf(""));
|
||||
pSub = pSub->GetNext(); // "y"
|
||||
pSub->SetValFloat(std::nanf(""));
|
||||
pSub->SetValFloat(nanf(""));
|
||||
pSub = pSub->GetNext(); // "z"
|
||||
pSub->SetValFloat(std::nanf(""));
|
||||
pSub->SetValFloat(nanf(""));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue