summaryrefslogtreecommitdiff
path: root/Zend/zend_portability.h
diff options
context:
space:
mode:
authorAnatol Belski <ab@php.net>2014-11-10 18:16:31 +0100
committerAnatol Belski <ab@php.net>2014-11-10 23:30:12 +0100
commit88ba5a625c7efb1001ce90c8f4649cff830d82a4 (patch)
tree8ed76e039e23aa568d5e6b19c8f318d2f2802c1b /Zend/zend_portability.h
parent09aa419d13204ffd1b4a705b8f04d6d25fc19556 (diff)
downloadphp-git-88ba5a625c7efb1001ce90c8f4649cff830d82a4.tar.gz
do portable socket checks
also introduced a portable macro for that
Diffstat (limited to 'Zend/zend_portability.h')
-rw-r--r--Zend/zend_portability.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/Zend/zend_portability.h b/Zend/zend_portability.h
index a6dac42b5a..f056b16338 100644
--- a/Zend/zend_portability.h
+++ b/Zend/zend_portability.h
@@ -394,6 +394,12 @@ char *alloca();
#define ZEND_SECURE_ZERO(var, size) memset((var), 0, (size))
#endif
+#ifdef ZEND_WIN32
+#define ZEND_VALID_SOCKET(sock) (INVALID_SOCKET != (sock))
+#else
+#define ZEND_VALID_SOCKET(sock) ((sock) >= 0)
+#endif
+
#endif /* ZEND_PORTABILITY_H */
/*