Warnings raised by Emscripten 1.38.0 and MinGW64 5.0.4 / GCC 8.3.0.
JS can now build with `werror=yes warnings=extra`.
MinGW64 still has a few warnings to resolve with `warnings=extra`,
and only one with `warnings=all`.
Part of #29033 and #29801.
Fixes the following GCC 5 warnings and actual bugs:
```
drivers/unix/net_socket_posix.cpp:562:28: warning: comparison between 'enum IP::Type' and 'enum NetSocket::Type' [-Wenum-compare]
modules/gdscript/gdscript_function.cpp:792:26: warning: comparison of constant '17' with boolean expression is always true [-Wbool-compare]
modules/gdscript/gdscript_function.cpp:792:26: warning: logical not is only applied to the left hand side of comparison [-Wlogical-not-parentheses]
modules/gdscript/gdscript_parser.cpp:5082:58: warning: comparison of constant '6' with boolean expression is always false [-Wbool-compare]
modules/gdscript/gdscript_parser.cpp:5082:58: warning: logical not is only applied to the left hand side of comparison [-Wlogical-not-parentheses]
modules/mbedtls/stream_peer_mbed_tls.cpp:286:45: warning: comparison between 'enum StreamPeerTCP::Status' and 'enum StreamPeerSSL::Status' [-Wenum-compare]
modules/mbedtls/stream_peer_mbed_tls.cpp:313:45: warning: comparison between 'enum StreamPeerTCP::Status' and 'enum StreamPeerSSL::Status' [-Wenum-compare]
```
Since Windows 2000:
Calling recv/recvfrom when an ICMP reply was received from a previous
send/sendto, may result in a WSAECONNRESET error.
Since Windows Vista(?)/Windows Server 2008:
Calling recv/recvfrom when an ICMP reply was received from a previous
send/sendto, may also result in a WSAENETRESET error.
Both those features are disabled by this commit using disabling
SIO_UDP_CONNRESET and SIO_UDP_NETRESET on newly created UDP sockets.
WSAPoll is broken by design.
It was announced as the new way to introduce compatibility to posix
sockets, their implementation was broken, and they decided not to fix it.
You can read the full story here:
https://daniel.haxx.se/blog/2012/10/10/wsapoll-is-broken/
Unified BSD and Winsock sockets into a single implementation of a
generic NetSocket interface.
This is some ground work for few network improvements:
- Reuse as much code as possible between Posix and Windows.
- Provide a single point of implementation for exotic sdks (consoles).
- Provide platform agnostic StreamPeerTCP and PacketPeerUDP in core.
- Implement connect for UDP allowing for DTLS implementation.