]> granicus.if.org Git - php/commitdiff
Renable socket_create_pair() on Windows
authorKalle Sommer Nielsen <kalle@php.net>
Thu, 1 Jan 2009 05:22:54 +0000 (05:22 +0000)
committerKalle Sommer Nielsen <kalle@php.net>
Thu, 1 Jan 2009 05:22:54 +0000 (05:22 +0000)
# ext/sockets have its own implementation of socketpair(), perhaps we should move it
# to the core. This will make stream_socket_pair() available on Windows aswell

ext/sockets/php_sockets.h
ext/sockets/sockets.c

index 5d160411d1cbd42ccb4ca15cf3f6d359630a24cc..f0c9cc5203aca5b02188bff16616c1e3c2244919 100644 (file)
@@ -43,7 +43,7 @@ PHP_RSHUTDOWN_FUNCTION(sockets);
 
 PHP_FUNCTION(socket_select);
 PHP_FUNCTION(socket_create_listen);
-#ifdef HAVE_SOCKETPAIR
+#if defined(HAVE_SOCKETPAIR) || defined(PHP_WIN32)
 PHP_FUNCTION(socket_create_pair);
 #endif
 PHP_FUNCTION(socket_accept);
index 13a995b58452feccc28ee73f381297a740df1672..62a2039eea463e535f5dd5e6b3077b42719af0d4 100644 (file)
@@ -223,7 +223,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_socket_set_option, 0, 0, 4)
        ZEND_ARG_INFO(0, optval)
 ZEND_END_ARG_INFO()
 
-#ifdef HAVE_SOCKETPAIR
+#if defined(HAVE_SOCKETPAIR) || defined(PHP_WIN32)
 ZEND_BEGIN_ARG_INFO_EX(arginfo_socket_create_pair, 0, 0, 4)
        ZEND_ARG_INFO(0, domain)
        ZEND_ARG_INFO(0, type)
@@ -254,7 +254,7 @@ const zend_function_entry sockets_functions[] = {
        PHP_FE(socket_select,                   arginfo_socket_select)
        PHP_FE(socket_create,                   arginfo_socket_create)
        PHP_FE(socket_create_listen,    arginfo_socket_create_listen)
-#ifdef HAVE_SOCKETPAIR
+#if defined(HAVE_SOCKETPAIR) || defined(PHP_WIN32)
        PHP_FE(socket_create_pair,              arginfo_socket_create_pair)
 #endif
        PHP_FE(socket_accept,                   arginfo_socket_accept)
@@ -1857,7 +1857,7 @@ PHP_FUNCTION(socket_set_option)
 }
 /* }}} */
 
-#ifdef HAVE_SOCKETPAIR
+#if defined(HAVE_SOCKETPAIR) || defined(PHP_WIN32)
 /* {{{ proto bool socket_create_pair(int domain, int type, int protocol, array &fd) U
    Creates a pair of indistinguishable sockets and stores them in fds. */
 PHP_FUNCTION(socket_create_pair)