From c9ddb6a651655c28cae326107877dc0fe1f4f384 Mon Sep 17 00:00:00 2001 From: jaynus Date: Sun, 31 May 2015 10:30:31 -0700 Subject: [PATCH] Fixes build errors in MSVC 2014/2015 compiling with latest CMake and c++11 libraries. Fixes #32 --- Lib/LibStatic/CMakeLists.txt | 2 +- Source/CCRakNetSlidingWindow.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Lib/LibStatic/CMakeLists.txt b/Lib/LibStatic/CMakeLists.txt index c116ee5f0..67e98587e 100644 --- a/Lib/LibStatic/CMakeLists.txt +++ b/Lib/LibStatic/CMakeLists.txt @@ -17,7 +17,7 @@ IF(WIN32 AND NOT UNIX) IF(NOT ${CMAKE_GENERATOR} STREQUAL "MSYS Makefiles") - IF( MSVC10 OR MSVC11 OR MSVC12 ) + IF( MSVC10 OR MSVC11 OR MSVC12 OR MSVC14 ) set_target_properties(RakNetLibStatic PROPERTIES STATIC_LIBRARY_FLAGS "/NODEFAULTLIB:\"LIBCD.lib LIBCMTD.lib MSVCRT.lib\"" ) ELSE() set_target_properties(RakNetLibStatic PROPERTIES STATIC_LIBRARY_FLAGS "/NODEFAULTLIB:"LIBCD.lib LIBCMTD.lib MSVCRT.lib"" ) diff --git a/Source/CCRakNetSlidingWindow.cpp b/Source/CCRakNetSlidingWindow.cpp index 611c3c02e..595197041 100644 --- a/Source/CCRakNetSlidingWindow.cpp +++ b/Source/CCRakNetSlidingWindow.cpp @@ -22,7 +22,7 @@ static const CCTimeType SYN=10000; #include "MTUSize.h" #include -#include +#include #include #include "RakAssert.h" #include "RakAlloca.h" @@ -218,7 +218,7 @@ void CCRakNetSlidingWindow::OnAck(CCTimeType curTime, CCTimeType rtt, bool hasBA double d = .05; double difference = rtt - estimatedRTT; estimatedRTT = estimatedRTT + d * difference; - deviationRtt = deviationRtt + d * (abs(difference) - deviationRtt); + deviationRtt = deviationRtt + d * (std::abs(difference) - deviationRtt); } _isContinuousSend=isContinuousSend;