There build was failing on rmtools on the sockets extension for two reasons:
1. IPV6_TCLASS and IPV6_RECVTCLASS not being defined. These are probably
recent additions to SDK. Windows 7 doesn't event seem to have complete
support for IPV6_TCLASS, not accepting in WSASendMsg(). The parts that
needed this constant were not guarded by #ifdefs. They are now.
2. The constants EWOULDBLOCK and EINPROGRESS not being defined. These
were only defined in php_network.h, outside of the extension, and not
all source files included this header. Nevertheless, a macro defined in
php_sockets.h needed these constants. When this macro was used in files
that did not include php_network.h, the compilation would fail.
Surprisingly, the build did not fail when using the 7.1 Windows SDK
(more likely, the CRT headers used in VC10), as somehow errno.h was
being included through some other standard header. This would make the
constant EWOULDBLOCK defined; however, it would be defined to the wrong
value. In the winsock context, WSAEWOULDBLOCK should be used instead.
Because we have difficulty using Windows-only constants in the code, we
(re)define EWOULDBLOCK to WSAEWOULDBLOCK. This has the obvious
disavantage we may miss problems like this again in the future.