-
Notifications
You must be signed in to change notification settings - Fork 1k
Fixes build errors in MSVC 2014/2015 compiling with latest CMake #64
base: master
Are you sure you want to change the base?
Conversation
…c++11 libraries. Fixes #32
thank you.. i'll try again and i say the result.. |
perfect! |
Now if only PRs ever got merged :p |
Using std::abs creates a linker problem with clang if you try to simply compile RakNet sources as a part of a program that uses std::string. There's another patch here on github that uses fabs() instead of std::abs(). I'm not sure about the original purpose of abs()? Is fabs() a valid solution? |
@@ -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 ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should probably be
if (MSVC_VERSION GREATER_EQUAL 1600)
So it keeps working in the future
@@ -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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To avoid problem on other platforms, we could use fabs
here, and keep math.h
As @mbabuskov mentioned.
Pull request integrated in https://github.com/SLikeSoft/SLikeNet (incorporated in SLikeNet 0.1.0). |
Due to lack of a different way to reach out to you, I'm adding this one as a comment to your pull request: Since we incorporated your pull request in SLikeNet, we'd like to offer you to be added to the acknowledgement section in the accompanying readme file. By default the entry would look like: Please let me know (preferably by email) if we'd add such an entry in the next release of SLikeNet for you (and in case you'd prefer a different style, how it should look like). If there's no reply from your side, we'll not add such an entry to respect your privacy. Note that for those who decided not to be listed in the acknowledgement section and/or those we failed to contact, we added the following generic statement to cover these contributions: |
References: #32
The latest version of CMake support MSVC14 (Visual Studio 2014/2015 CTP). Raknet fails to build in these circumstances due to version-specific MSVC checks, as well as STL changes due to c++11/14 implementations in MSVC.
These fix the ambiguity errors present in new MSVC STL implementation and adds latest MSVC to build system.