aboutsummaryrefslogtreecommitdiff
path: root/libjava/gnu
diff options
context:
space:
mode:
authorRainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>2012-04-05 10:04:40 +0000
committerRainer Orth <ro@gcc.gnu.org>2012-04-05 10:04:40 +0000
commit0e74b5a21f888f99315cfa8ac762d13b7e51a79c (patch)
tree3f85d964c778e070253ec54b2d0650658a10805e /libjava/gnu
parent3d3f224949f46f992c30ef39036b6f0d20c2406d (diff)
downloadgcc-0e74b5a21f888f99315cfa8ac762d13b7e51a79c.zip
gcc-0e74b5a21f888f99315cfa8ac762d13b7e51a79c.tar.gz
gcc-0e74b5a21f888f99315cfa8ac762d13b7e51a79c.tar.bz2
Restore HAVE_INET6 tests (PR libgcj/52645)
PR libgcj/52645 * gnu/java/net/natPlainDatagramSocketImplPosix.cc (setOption): Restore HAVE_INET6 check. * gnu/java/net/natPlainDatagramSocketImplWin32.cc (setOption): Likewise. From-SVN: r186161
Diffstat (limited to 'libjava/gnu')
-rw-r--r--libjava/gnu/java/net/natPlainDatagramSocketImplPosix.cc2
-rw-r--r--libjava/gnu/java/net/natPlainDatagramSocketImplWin32.cc12
2 files changed, 9 insertions, 5 deletions
diff --git a/libjava/gnu/java/net/natPlainDatagramSocketImplPosix.cc b/libjava/gnu/java/net/natPlainDatagramSocketImplPosix.cc
index edec051..6ec9f38 100644
--- a/libjava/gnu/java/net/natPlainDatagramSocketImplPosix.cc
+++ b/libjava/gnu/java/net/natPlainDatagramSocketImplPosix.cc
@@ -655,6 +655,7 @@ gnu::java::net::PlainDatagramSocketImpl::setOption (jint optID,
len = sizeof (struct in_addr);
ptr = (const char *) &u.addr;
}
+#ifdef HAVE_INET6
else if (len == 16)
{
level = IPPROTO_IPV6;
@@ -663,6 +664,7 @@ gnu::java::net::PlainDatagramSocketImpl::setOption (jint optID,
len = sizeof (struct in6_addr);
ptr = (const char *) &u.addr6;
}
+#endif
else
throw
new ::java::net::SocketException (JvNewStringUTF ("invalid length"));
diff --git a/libjava/gnu/java/net/natPlainDatagramSocketImplWin32.cc b/libjava/gnu/java/net/natPlainDatagramSocketImplWin32.cc
index d659b0b..eb1dd96 100644
--- a/libjava/gnu/java/net/natPlainDatagramSocketImplWin32.cc
+++ b/libjava/gnu/java/net/natPlainDatagramSocketImplWin32.cc
@@ -540,6 +540,7 @@ gnu::java::net::PlainDatagramSocketImpl::setOption (jint optID,
len = sizeof (struct in_addr);
ptr = (const char *) &u.addr;
}
+#ifdef HAVE_INET6
else if (len == 16)
{
level = IPPROTO_IPV6;
@@ -548,6 +549,7 @@ gnu::java::net::PlainDatagramSocketImpl::setOption (jint optID,
len = sizeof (struct in6_addr);
ptr = (const char *) &u.addr6;
}
+#endif
else
throw
new ::java::net::SocketException (JvNewStringUTF ("invalid length"));
@@ -635,14 +637,14 @@ gnu::java::net::PlainDatagramSocketImpl::getOption (jint optID)
goto error;
if (u.address.sin_family == AF_INET)
{
- laddr = JvNewByteArray (4);
- memcpy (elements (laddr), &u.address.sin_addr, 4);
+ laddr = JvNewByteArray (4);
+ memcpy (elements (laddr), &u.address.sin_addr, 4);
}
#ifdef HAVE_INET6
- else if (u.address.sin_family == AF_INET6)
+ else if (u.address.sin_family == AF_INET6)
{
- laddr = JvNewByteArray (16);
- memcpy (elements (laddr), &u.address6.sin6_addr, 16);
+ laddr = JvNewByteArray (16);
+ memcpy (elements (laddr), &u.address6.sin6_addr, 16);
}
#endif
else