Skip to content
This repository has been archived by the owner on Jan 13, 2022. It is now read-only.

Fixes build errors in MSVC 2014/2015 compiling with latest CMake #64

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

jaynus
Copy link

@jaynus jaynus commented May 31, 2015

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.

@perminovVS perminovVS mentioned this pull request Aug 10, 2015
@Xitano
Copy link

Xitano commented Aug 10, 2015

thank you.. i'll try again and i say the result..

@Xitano
Copy link

Xitano commented Aug 10, 2015

perfect!

@jaynus
Copy link
Author

jaynus commented Aug 11, 2015

Now if only PRs ever got merged :p

@mbabuskov
Copy link

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 )
Copy link

@davidstlyoui davidstlyoui Apr 3, 2017

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);
Copy link

@davidstlyoui davidstlyoui Apr 3, 2017

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.

@Luke1410
Copy link

Luke1410 commented Aug 2, 2017

Pull request integrated in https://github.com/SLikeSoft/SLikeNet (incorporated in SLikeNet 0.1.0).

@Luke1410
Copy link

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:
jaynus: https://github.com/jaynus (pull request: RAKPR_64)

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:
"We'd also like to thank those contributors who have requested to remain
anonymous and/or those who we could not contact at all (due to lack of contact
information)."

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants