summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configure.ac4
-rw-r--r--native/jni/java-net/gnu_java_net_VMPlainSocketImpl.c6
-rw-r--r--native/jni/java-nio/gnu_java_nio_VMChannel.c2
-rw-r--r--native/jni/java-nio/gnu_java_nio_VMSelector.c3
-rw-r--r--native/jni/java-nio/javanio.c2
-rw-r--r--native/jni/java-nio/javanio.h2
-rw-r--r--native/jni/native-lib/cpio.c4
-rw-r--r--native/jni/native-lib/cpnet.h4
8 files changed, 22 insertions, 5 deletions
diff --git a/configure.ac b/configure.ac
index 4dea1a33d..12ba1a2c7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -368,6 +368,7 @@ if test "x${COMPILE_JNI}" = xyes; then
dnl On that system, sys/ioctl.h will not include sys/filio.h unless
dnl BSD_COMP is defined; just including sys/filio.h is simpler.
dnl Check for crt_externs.h on Darwin.
+ dnl Check for netinet/in_systm.h, netinet/ip.h and net/if.h for Windows CE.
AC_CHECK_HEADERS([unistd.h sys/types.h sys/config.h sys/ioctl.h \
asm/ioctls.h \
inttypes.h stdint.h utime.h sys/utime.h sys/filio.h \
@@ -378,7 +379,8 @@ if test "x${COMPILE_JNI}" = xyes; then
sys/mman.h \
magic.h \
sys/event.h sys/epoll.h \
- ifaddrs.h])
+ ifaddrs.h \
+ netinet/in_systm.h netinet/ip.h net/if.h])
AC_EGREP_HEADER(uint32_t, stdint.h, AC_DEFINE(HAVE_INT32_DEFINED, 1, [Define to 1 if you have uint32_t]))
AC_EGREP_HEADER(uint32_t, inttypes.h, AC_DEFINE(HAVE_INT32_DEFINED, 1, [Define to 1 if you have uint32_t]))
diff --git a/native/jni/java-net/gnu_java_net_VMPlainSocketImpl.c b/native/jni/java-net/gnu_java_net_VMPlainSocketImpl.c
index a59604c04..c9620a4e7 100644
--- a/native/jni/java-net/gnu_java_net_VMPlainSocketImpl.c
+++ b/native/jni/java-net/gnu_java_net_VMPlainSocketImpl.c
@@ -51,7 +51,9 @@ exception statement from your version. */
#endif
#include <netinet/in.h>
#include <netinet/tcp.h>
+#ifdef HAVE_NET_IF_H
#include <net/if.h>
+#endif
#include <errno.h>
#include <stdlib.h>
#include <stdio.h>
@@ -416,7 +418,7 @@ Java_gnu_java_net_VMPlainSocketImpl_setMulticastInterface6 (JNIEnv *env,
#ifdef HAVE_INET6
int result;
const char *str_ifname = JCL_jstring_to_cstring (env, ifname);
- u_int if_index;
+ unsigned int if_index;
if ((*env)->ExceptionOccurred (env))
{
@@ -433,7 +435,7 @@ Java_gnu_java_net_VMPlainSocketImpl_setMulticastInterface6 (JNIEnv *env,
}
result = setsockopt(fd, IPPROTO_IPV6, IPV6_MULTICAST_IF,
- (u_int *) &if_index, sizeof(if_index));
+ (unsigned int *) &if_index, sizeof(if_index));
JCL_free_cstring(env, ifname, str_ifname);
diff --git a/native/jni/java-nio/gnu_java_nio_VMChannel.c b/native/jni/java-nio/gnu_java_nio_VMChannel.c
index a5bbd7126..7899f0b94 100644
--- a/native/jni/java-nio/gnu_java_nio_VMChannel.c
+++ b/native/jni/java-nio/gnu_java_nio_VMChannel.c
@@ -43,7 +43,9 @@ exception statement from your version. */
#include <config-int.h>
#include <sys/types.h>
+#ifdef HAVE_SYS_MMAN_H
#include <sys/mman.h>
+#endif
#include <sys/socket.h>
#include <sys/stat.h>
#include <sys/uio.h>
diff --git a/native/jni/java-nio/gnu_java_nio_VMSelector.c b/native/jni/java-nio/gnu_java_nio_VMSelector.c
index 74a408c75..19a6f244d 100644
--- a/native/jni/java-nio/gnu_java_nio_VMSelector.c
+++ b/native/jni/java-nio/gnu_java_nio_VMSelector.c
@@ -41,8 +41,9 @@ exception statement from your version. */
#if defined(HAVE_SYS_TYPES_H)
#include <sys/types.h>
#endif
-
+#if defined(HAVE_SYS_SELECT_H)
#include <sys/select.h>
+#endif
#include <sys/time.h>
#include <string.h>
diff --git a/native/jni/java-nio/javanio.c b/native/jni/java-nio/javanio.c
index 09806f8ba..a7018b347 100644
--- a/native/jni/java-nio/javanio.c
+++ b/native/jni/java-nio/javanio.c
@@ -45,7 +45,9 @@ exception statement from your version. */
#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>
+#ifdef HAVE_SYS_SELECT_H
#include <sys/select.h>
+#endif
#include <sys/uio.h>
CPNIO_EXPORT ssize_t
diff --git a/native/jni/java-nio/javanio.h b/native/jni/java-nio/javanio.h
index bdd11055e..cc31cf3c1 100644
--- a/native/jni/java-nio/javanio.h
+++ b/native/jni/java-nio/javanio.h
@@ -39,6 +39,8 @@ exception statement from your version. */
#ifndef __JAVANIO_H__
#define __JAVANIO_H__
+#include <sys/time.h>
+
/**
* This header defines functions that are called by our JNI reference
* implementation of java.nio.*. In our reference implementation, these
diff --git a/native/jni/native-lib/cpio.c b/native/jni/native-lib/cpio.c
index 605bd7f99..0ef97f185 100644
--- a/native/jni/native-lib/cpio.c
+++ b/native/jni/native-lib/cpio.c
@@ -349,9 +349,11 @@ int cpio_setFileReadonly (const char *filename)
if (stat(filename, &statbuf) < 0)
return errno;
-
+
+#ifdef S_IWRITE
if (chmod(filename, statbuf.st_mode & ~(S_IWRITE | S_IWGRP | S_IWOTH)) < 0)
return errno;
+#endif
return 0;
}
diff --git a/native/jni/native-lib/cpnet.h b/native/jni/native-lib/cpnet.h
index 72850b4c8..979c363c2 100644
--- a/native/jni/native-lib/cpnet.h
+++ b/native/jni/native-lib/cpnet.h
@@ -44,9 +44,13 @@ exception statement from your version. */
#include <sys/types.h>
#include <sys/socket.h>
+#ifdef HAVE_NETINET_IN_SYSTM_H
#include <netinet/in_systm.h>
+#endif /* HAVE_NETINET_IN_SYSTM_H */
#include <netinet/in.h>
+#ifdef HAVE_NETINET_IP_H
#include <netinet/ip.h>
+#endif /* HAVE_NETINET_IP_H */
typedef struct {
jint len;