moriyoshi Fri Apr 4 08:02:43 2003 EDT
Modified files:
/php4 configure.in
/php4/ext/sockets sockets.c
Log:
Added cmsghdr check. Now sockets extension can be built under cygwin.
Index: php4/configure.in
diff -u php4/configure.in:1.439 php4/configure.in:1.440
--- php4/configure.in:1.439 Thu Apr 3 15:59:42 2003
+++ php4/configure.in Fri Apr 4 08:02:42 2003
@@ -1,4 +1,4 @@
-dnl ## $Id: configure.in,v 1.439 2003/04/03 20:59:42 helly Exp $ -*- sh -*-
+dnl ## $Id: configure.in,v 1.440 2003/04/04 13:02:42 moriyoshi Exp $ -*- sh -*-
dnl ## Process this file with autoconf to produce a configure script.
divert(1)
@@ -425,6 +425,15 @@
ac_cv_sockaddr_storage=yes, ac_cv_sockaddr_storage=no)])
if test "$ac_cv_sockaddr_storage" = yes; then
AC_DEFINE(HAVE_SOCKADDR_STORAGE,1,[Whether you have struct sockaddr_storage])
+fi
+
+dnl Check for struct sockaddr_storage
+AC_CACHE_CHECK([for struct cmsghdr], ac_cv_cmsghdr,
+[AC_TRY_COMPILE([ #include <sys/types.h>
+#include <sys/socket.h>], [struct cmsghdr s; s],
+ ac_cv_cmsghdr=yes, ac_cv_cmsghdr=no)])
+if test "$ac_cv_cmsghdr" = yes; then
+ AC_DEFINE(HAVE_CMSGHDR,1,[Whether you have struct cmsghdr])
fi
dnl Check if sockaddr data structure includes an "sa_len" member
Index: php4/ext/sockets/sockets.c
diff -u php4/ext/sockets/sockets.c:1.133 php4/ext/sockets/sockets.c:1.134
--- php4/ext/sockets/sockets.c:1.133 Mon Mar 10 10:52:10 2003
+++ php4/ext/sockets/sockets.c Fri Apr 4 08:02:43 2003
@@ -19,7 +19,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: sockets.c,v 1.133 2003/03/10 15:52:10 ddhill Exp $ */
+/* $Id: sockets.c,v 1.134 2003/04/04 13:02:43 moriyoshi Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -139,7 +139,9 @@
PHP_FE(socket_send, NULL)
PHP_FE(socket_recvfrom, second_fifth_and_sixth_args_force_ref)
PHP_FE(socket_sendto, NULL)
+#ifdef HAVE_CMSGHDR
PHP_FE(socket_recvmsg, third_through_seventh_args_force_ref)
+#endif
PHP_FE(socket_sendmsg, NULL)
PHP_FE(socket_readv, NULL)
PHP_FE(socket_writev, NULL)
@@ -1505,6 +1507,7 @@
/* {{{ proto bool socket_recvmsg(resource socket, resource iovec, array &control, int
&controllen, int &flags, string &addr [, int &port])
Used to receive messages on a socket, whether connection-oriented or not */
+#ifdef HAVE_CMSGHDR
PHP_FUNCTION(socket_recvmsg)
{
zval *arg1, *arg2, *arg3, *arg4, *arg5,
*arg6, *arg7 = NULL;
@@ -1643,6 +1646,7 @@
RETURN_FALSE;
}
}
+#endif
/* }}} */
/* {{{ proto bool socket_sendmsg(resource socket, resource iovec, int flags, string
addr [, int port])
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php