don't include winsock2.h in public headers#68
Open
ligfx wants to merge 1 commit into
Open
Conversation
Windows headers have a tendency to pollute the global namespace and can cause issues with code that's not expecting it. enet should be a friendly neighbor and not expose Windows headers to end-users.
2e7062d to
f9bc5a8
Compare
Author
|
@lsalzman Any thoughts on this? |
Owner
|
This won't work because the ENET_SOCKETSET_* and the ENET_HOST_TO_NET/ENET_NET_TO_HOST macros require winsock, and may be used as part of ENet's API. |
Author
|
Dang, I didn't see those. Would you be open to another solution like, forward-declaring the My use-case is I want to keep Windows headers out of my code headers (so they don't propagate), but still be able to use ENet directly in member variables or for function arguments. |
Owner
|
I'll work something out with a define you can use before including to stop winsock. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Windows headers have a tendency to pollute the global namespace and can cause issues with code that's not expecting it. enet should be a friendly neighbor and not expose Windows headers to end-users :)