hi all,

the attached patch checks for MSG_WAITALL since it does not exist on Cygwin, and fixes the respective build failure in the nio code by defining the flag to be 0 in the case it does not exist on a system.

cheers,
dalibor topic

2007-06-25  Dalibor Topic  <[EMAIL PROTECTED]>

        * configure.ac: Check for MSG_WAITALL, since it does not exist
        on Cygwin.

        * native/jni/java-nio/gnu_java_nio_VMChannel.c
        (Java_gnu_java_nio_VMChannel_receive): Define MSG_WAITALL as 0
        if it does not exist.

--- configure.ac        10 Jun 2007 21:16:42 -0000      1.210
+++ configure.ac        24 Jun 2007 20:38:25 -0000
@@ -589,6 +589,17 @@
              [Define this symbol if you have SO_NOSIGPIPE]) ],
   [ AC_MSG_RESULT(no)]
  )
+  dnl **********************************************************************
+  dnl Check for MSG_WAITALL
+  dnl **********************************************************************
+  AC_MSG_CHECKING(for MSG_WAITALL)
+  AC_TRY_COMPILE([#include <sys/socket.h>],
+   [ int f = MSG_WAITALL; ],
+   [ AC_MSG_RESULT(yes)
+     AC_DEFINE(HAVE_MSG_WAITALL, 1,
+              [Define this symbol if you have MSG_WAITALL]) ],
+   [ AC_MSG_RESULT(no)]
+  )
 
   dnl Check for plugin support headers and libraries.
   if test "x${COMPILE_PLUGIN}" = xyes; then
Index: examples/Makefile.am
===================================================================
RCS file: /sources/classpath/classpath/examples/Makefile.am,v
retrieving revision 1.20
--- native/jni/java-nio/gnu_java_nio_VMChannel.c	30 May 2007 09:56:57 -0000	1.19
+++ native/jni/java-nio/gnu_java_nio_VMChannel.c	24 Jun 2007 20:38:40 -0000
@@ -771,6 +771,10 @@
   if (JCL_init_buffer (env, &buf, dst) == -1)
     JCL_ThrowException (env, IO_EXCEPTION, "loading buffer failed");
 
+#ifndef HAVE_MSG_WAITALL
+#define MSG_WAITALL       0
+#endif
+
   ret = cpnio_recvfrom (fd, &(buf.ptr[buf.position + buf.offset]),
                         buf.limit - buf.position, MSG_WAITALL,
                         sockaddr, &slen);
Index: native/jni/native-lib/cpnet.c
===================================================================
RCS file: /sources/classpath/classpath/native/jni/native-lib/cpnet.c,v
retrieving revision 1.8

Reply via email to