*Stupid* vc++ compiler never ceases to amaze me how pathetic it is.

This commit is contained in:
Mark Vejvoda 2013-11-03 07:55:20 +00:00
parent 8d4f5a9f40
commit 9a3463330c
1 changed files with 6 additions and 1 deletions

View File

@ -28,6 +28,7 @@
#include "data_types.h"
#include "leak_dumper.h"
using namespace std;
using namespace Shared::Platform;
namespace Shared{ namespace Graphics{
@ -61,7 +62,11 @@ inline T truncateDecimal(const T &value, int precision=6) {
}
// See if we can avoid using an int64 for speed
static int MAX_INT_VALUE = std::numeric_limits<int>::max();
// To avoid stupid VC++ compiler error: illegal token on right side of '::'
#ifdef WIN32
#undef max
#endif
static int MAX_INT_VALUE = numeric_limits<int>::max();
if((T)value * (T)precNum <= MAX_INT_VALUE) {
int resultInt = (T)value * (T)precNum;
T result = (T)resultInt / precNum;