[Project64] Fix rounding code to compile on VS 2008

This commit is contained in:
zilmar 2016-01-18 05:44:19 +11:00
parent 0f4ddee3eb
commit e212bee0a4
3 changed files with 33 additions and 0 deletions

View File

@ -157,6 +157,10 @@
RelativePath=".\path.cpp"
>
</File>
<File
RelativePath=".\Platform.cpp"
>
</File>
<File
RelativePath=".\stdafx.cpp"
>
@ -230,6 +234,10 @@
RelativePath=".\path.h"
>
</File>
<File
RelativePath=".\Platform.h"
>
</File>
<File
RelativePath=".\SmartPointer.h"
>

View File

@ -21,6 +21,30 @@
#include <float.h>
#include <math.h>
#if (defined(_MSC_VER) && (_MSC_VER < 1800))
double round(double num)
{
return (num - floor(num) > 0.5) ? ceil(num) : floor(num);
}
float roundf(float num)
{
return (num - floorf(num) > 0.5) ? ceilf(num) : floorf(num);
}
#endif
#if (defined(_MSC_VER) && (_MSC_VER < 1700))
double trunc(double num)
{
return (num < 0) ? ceil(num) : floor(num);
}
float truncf(float num)
{
return (num < 0) ? ceilf(num) : floorf(num);
}
#endif
void InPermLoop();
void TestInterpreterJump(uint32_t PC, uint32_t TargetPC, int32_t Reg1, int32_t Reg2);

View File

@ -16,6 +16,7 @@
#include <stdio.h>
#include <string.h>
#include <float.h>
#include "x86CodeLog.h"
uint32_t CRegInfo::m_fpuControl = 0;