From f4f4277a5f4383f1871830466e38292428405fe4 Mon Sep 17 00:00:00 2001 From: Dalibor Topic Date: Fri, 28 Dec 2007 17:49:55 +0000 Subject: build fixes for arm-wince 2007-12-28 Dalibor Topic * configure.ac (AC_CHECK_HEADERS): Check for netinet/in_systm.h, netinet/ip.h and net/if.h for Windows CE. * native/jni/java-net/gnu_java_net_VMPlainSocketImpl.c: Guard net/if.h include statement. Use unsigned int instead of u_int. * native/jni/java-nio/gnu_java_nio_VMChannel.c: Guard sys/mman.h include statement. * native/jni/java-nio/gnu_java_nio_VMSelector.c: Guard sys/select.h include statement. * native/jni/java-nio/javanio.c: Guard sys/select.h include statement. * native/jni/java-nio/javanio.h: Include sys/time.h. * native/jni/native-lib/cpio.c: Guard chmod call by S_IWRITE, since it's not defined in the arm-wince toolchain. * native/jni/native-lib/cpnet.h: Guard netinet/in_systm.h and netinet/ip.h include statements. --- native/jni/java-net/gnu_java_net_VMPlainSocketImpl.c | 6 ++++-- native/jni/java-nio/gnu_java_nio_VMChannel.c | 2 ++ native/jni/java-nio/gnu_java_nio_VMSelector.c | 3 ++- native/jni/java-nio/javanio.c | 2 ++ native/jni/java-nio/javanio.h | 2 ++ native/jni/native-lib/cpio.c | 4 +++- native/jni/native-lib/cpnet.h | 4 ++++ 7 files changed, 19 insertions(+), 4 deletions(-) (limited to 'native') 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 #include +#ifdef HAVE_NET_IF_H #include +#endif #include #include #include @@ -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 #include +#ifdef HAVE_SYS_MMAN_H #include +#endif #include #include #include 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 #endif - +#if defined(HAVE_SYS_SELECT_H) #include +#endif #include #include 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 #include #include +#ifdef HAVE_SYS_SELECT_H #include +#endif #include 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 + /** * 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 #include +#ifdef HAVE_NETINET_IN_SYSTM_H #include +#endif /* HAVE_NETINET_IN_SYSTM_H */ #include +#ifdef HAVE_NETINET_IP_H #include +#endif /* HAVE_NETINET_IP_H */ typedef struct { jint len; -- cgit v1.2.1