Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

COMMON: Don't include win32.h in common/encoding.h #1828

Merged
merged 1 commit into from Sep 2, 2019

Conversation

@SupSuper
Copy link
Contributor

commented Sep 1, 2019

Currently encoding.h includes win32.h to expose switchEndian to the backend. This has the nasty side effect of exposing poor defenseless engines to the cthulhuian horrors of Win32. In this case, Testbed doesn't compile on MSVC because Win32 requires language extensions.

I replaced the include with just making switchEndian public, since it's static anyways, so a friend class seems excessive. @vyzigold let me know if this is ok.

@vyzigold

This comment has been minimized.

Copy link
Contributor

commented Sep 1, 2019

I didn't want the method to be public inside the Common::Encoding, because the method doesn't do anything with character encoding, so that is why I made it like this, but I didn't test this with MSVC, only with MinGW. Your solution should be ok.

@sluicebox

This comment has been minimized.

Copy link
Member

commented Sep 2, 2019

Confirmed that this fixes VS2015 and VS2019

@bluegr

This comment has been minimized.

Copy link
Member

commented Sep 2, 2019

Great work! Merging

@bluegr bluegr merged commit 1c1cc91 into scummvm:master Sep 2, 2019

2 checks passed

Codacy/PR Quality Review Up to standards. A positive pull request.
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.