Skip to content

Winsock Deprecated Warnings "Fix"#1

Open
CTxCB wants to merge 2 commits intoSmilex:masterfrom
CTxCB:master
Open

Winsock Deprecated Warnings "Fix"#1
CTxCB wants to merge 2 commits intoSmilex:masterfrom
CTxCB:master

Conversation

@CTxCB
Copy link

@CTxCB CTxCB commented May 4, 2018

Prevents Winsock Deprecated Warnings, which currently appear because of deprecated functions are in use and require #define _WINSOCK_DEPRECATED_NO_WARNINGS, I've also made non_blocking an unsigned long instead of an int, because Visual Studio 2017 is throwing a compiler error trying to convert an int * to a u_long *.

Prevents Winsock Deprecated Warnings, which currently appear because of deprecated functions are in use and require `#define _WINSOCK_DEPRECATED_NO_WARNINGS`, I've also made `non_blocking` an unsigned long instead of an int, because Visual Studio 2017 is throwing a compiler error trying to convert an int * to a u_long *.
@Themperror
Copy link

The define should be removed as the users need to know the functions being used are deprecated.
ioctlsocket (https://msdn.microsoft.com/en-us/library/windows/desktop/ms738573(v=vs.85).aspx )
does require u_longs* instead of int*, depending on compiler/platform they might be the same size (but not guaranteed) but it will always violate strict aliasing rules (signed / unsigned and long / int)

I've made this have it's own Zed_Net define, which could eventually cover other platform(s) socket deprecation stuff!
@CTxCB
Copy link
Author

CTxCB commented May 4, 2018

@Themperror I've made these an optional fix by adding a check for #define ZED_NET_IGNORE_DEPRECATION_WARNINGS, which could eventually cover deprecated function warnings in other platform's built-in socket code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants