diff options
Diffstat (limited to 'Zend/zend_portability.h')
| -rw-r--r-- | Zend/zend_portability.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Zend/zend_portability.h b/Zend/zend_portability.h index c159fdc77b..73a4f3b962 100644 --- a/Zend/zend_portability.h +++ b/Zend/zend_portability.h @@ -74,6 +74,10 @@ # include <alloca.h> #endif +#if defined(ZEND_WIN32) +#include <intrin.h> +#endif + /* Only use this macro if you know for sure that all of the switches values are covered by its case statements */ #if ZEND_DEBUG @@ -390,6 +394,13 @@ char *alloca(); #define ZEND_SECURE_ZERO(var, size) memset((var), 0, (size)) #endif +/* This check should only be used on network socket, not file descriptors */ +#ifdef ZEND_WIN32 +#define ZEND_VALID_SOCKET(sock) (INVALID_SOCKET != (sock)) +#else +#define ZEND_VALID_SOCKET(sock) ((sock) >= 0) +#endif + #endif /* ZEND_PORTABILITY_H */ /* |
