summaryrefslogtreecommitdiff
path: root/ext/sockets/php_sockets.h
diff options
context:
space:
mode:
authorGustavo Lopes <glopes@nebm.ist.utl.pt>2013-02-03 01:22:44 +0100
committerGustavo Lopes <glopes@nebm.ist.utl.pt>2013-02-03 01:36:14 +0100
commitaf1b90d62ba69953de2065864d2a1284314323ba (patch)
treedd16c23c9eb42f0b70d9668955ef3b89295f66e1 /ext/sockets/php_sockets.h
parent6ba5d0a4a5b714c048e0ded9933bfef2031f17c2 (diff)
downloadphp-git-af1b90d62ba69953de2065864d2a1284314323ba.tar.gz
Fix bug and hopefully build on WinSDK 6.1
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.
Diffstat (limited to 'ext/sockets/php_sockets.h')
-rw-r--r--ext/sockets/php_sockets.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/ext/sockets/php_sockets.h b/ext/sockets/php_sockets.h
index bad83b34cc..dd2b9933f6 100644
--- a/ext/sockets/php_sockets.h
+++ b/ext/sockets/php_sockets.h
@@ -27,6 +27,9 @@
#if HAVE_SOCKETS
#include <php.h>
+#ifdef PHP_WIN32
+# include "windows_common.h"
+#endif
extern zend_module_entry sockets_module_entry;
#define phpext_sockets_ptr &sockets_module_entry