diff options
Diffstat (limited to 'libjava/include/win32.h')
-rw-r--r-- | libjava/include/win32.h | 31 |
1 files changed, 24 insertions, 7 deletions
diff --git a/libjava/include/win32.h b/libjava/include/win32.h index d4c0ab6c18d..969af0818f9 100644 --- a/libjava/include/win32.h +++ b/libjava/include/win32.h @@ -1,6 +1,6 @@ // win32.h -- Helper functions for Microsoft-flavored OSs. -/* Copyright (C) 2002 Free Software Foundation +/* Copyright (C) 2002, 2003 Free Software Foundation This file is part of libgcj. @@ -14,9 +14,7 @@ details. */ #include <windows.h> #undef STRICT -#undef __INSIDE_CYGWIN__ -#include <winsock.h> -#define IP_TOS 3 +#include <ws2tcpip.h> #include <gcj/cni.h> #include <java/util/Properties.h> @@ -32,6 +30,11 @@ details. */ #define ENOTCONN 0 #define ECONNRESET 0 +/* This is incorrect, but allows java/net/natPlainDatagramSocketImpl.cc + to compile under MingW. This will be remedied in a subsequent gcj + release where the Win32 and Posix networking code have been forked. */ +#define ECONNREFUSED 0 + #ifndef ENOPROTOOPT #define ENOPROTOOPT 109 #endif @@ -41,6 +44,7 @@ details. */ extern void _Jv_platform_initialize (void); extern void _Jv_platform_initProperties (java::util::Properties*); extern jlong _Jv_platform_gettimeofday (); +extern int _Jv_select (int n, fd_set *, fd_set *, fd_set *, struct timeval *); inline void _Jv_platform_close_on_exec (jint) @@ -48,6 +52,21 @@ _Jv_platform_close_on_exec (jint) // Ignore. } +#ifdef JV_HASH_SYNCHRONIZATION +/* Suspends the execution of the current thread for the specified + number of microseconds. Tries to emulate the behaviour of usleep() + on UNIX and provides a granularity of 1 millisecond. */ +inline void +_Jv_platform_usleep (unsigned long usecs) +{ + if (usecs > 0UL) + { + unsigned long millis = ((usecs + 999UL) / 1000UL); + Sleep (millis); + } +} +#endif /* JV_HASH_SYNCHRONIZATION */ + #ifndef DISABLE_JAVA_NET static inline int @@ -59,7 +78,7 @@ _Jv_socket (int domain, int type, int protocol) inline int _Jv_connect (jint fd, sockaddr *ptr, int len) { - return ::connect (fd, ptr, len); + return ::connect (fd, ptr, len); } inline int @@ -100,8 +119,6 @@ _Jv_read(int s, void *buf, int len) #endif /* DISABLE_JAVA_NET */ -#define HAVE_BACKTRACE - /* Store up to SIZE return address of the current program state in ARRAY and return the exact number of values stored. */ extern int backtrace (void **__array, int __size); |