re PR libgcj/3694 (natPlainDatagramSocketImpl.cc doesn't compile in ALPHA OSF1)
* include/posix.h (_POSIX_PII_SOCKET): Define. * configure.in (HAVE_SOCKLEN_T): Define. * java/net/natPlainSocketImpl.cc [!HAVE_SOCKLEN_T]: Move socklen_t definition up. (_JV_accept): New function, avoids Tru64 UNIX accept macro. (java::net::PlainSocketImpl::accept): Use it. Fixes PRs libgcj/3694, libgcj/3696. * configure.in (HAVE_STRUCT_IPV6_MREQ): New test. * acconfig.h (HAVE_STRUCT_IPV6_MREQ): Provide template. * configure, include/config.h.in: Regenerate. * java/net/natPlainDatagramSocketImpl.cc (union McastReq): Use it. (mcastGrp): Likewise. (java::net::PlainDatagramSocketImpl::setOption): Guard against missing IPV6_MULTICAST_IF. Fixes PR libgcj/3694. From-SVN: r44546
This commit is contained in:
parent
2a25b23f7f
commit
60a78ccfac
8 changed files with 380 additions and 314 deletions
|
@ -33,6 +33,10 @@ details. */
|
|||
#include <bstring.h>
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_SOCKLEN_T
|
||||
typedef int socklen_t;
|
||||
#endif
|
||||
|
||||
// Avoid macro definitions of bind, connect from system headers, e.g. on
|
||||
// Solaris 7 with _XOPEN_SOURCE. FIXME
|
||||
static inline int
|
||||
|
@ -55,6 +59,17 @@ _Jv_connect (int fd, struct sockaddr *addr, int addrlen)
|
|||
#undef connect
|
||||
#endif
|
||||
|
||||
// Same problem with accept on Tru64 UNIX with _POSIX_PII_SOCKET
|
||||
static inline int
|
||||
_Jv_accept (int fd, struct sockaddr *addr, socklen_t *addrlen)
|
||||
{
|
||||
return ::accept (fd, addr, addrlen);
|
||||
}
|
||||
|
||||
#ifdef accept
|
||||
#undef accept
|
||||
#endif
|
||||
|
||||
#include <gcj/cni.h>
|
||||
#include <gcj/javaprims.h>
|
||||
#include <java/io/IOException.h>
|
||||
|
@ -126,10 +141,6 @@ java::net::PlainSocketImpl::getOption (jint)
|
|||
|
||||
#else /* DISABLE_JAVA_NET */
|
||||
|
||||
#ifndef HAVE_SOCKLEN_T
|
||||
typedef int socklen_t;
|
||||
#endif
|
||||
|
||||
union SockAddr
|
||||
{
|
||||
struct sockaddr_in address;
|
||||
|
@ -283,7 +294,7 @@ java::net::PlainSocketImpl::accept (java::net::PlainSocketImpl *s)
|
|||
JvNewStringUTF("Accept timed out"));
|
||||
}
|
||||
|
||||
new_socket = ::accept (fnum, (sockaddr*) &u, &addrlen);
|
||||
new_socket = _Jv_accept (fnum, (sockaddr*) &u, &addrlen);
|
||||
if (new_socket < 0)
|
||||
goto error;
|
||||
jbyteArray raddr;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue