diff options
Diffstat (limited to 'libjava/win32.cc')
-rw-r--r-- | libjava/win32.cc | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/libjava/win32.cc b/libjava/win32.cc index f425462523d..57c63789f36 100644 --- a/libjava/win32.cc +++ b/libjava/win32.cc @@ -10,6 +10,7 @@ details. */ #include <config.h> #include <jvm.h> +#include <sys/timeb.h> #include "platform.h" #include <java/lang/ArithmeticException.h> @@ -39,10 +40,25 @@ _Jv_platform_initialize (void) } // gettimeofday implementation. -void -_Jv_platform_gettimeofday (struct timeval *tv) +jlong +_Jv_platform_gettimeofday () { - // FIXME - return; + struct timeb t; + ftime (&t); + return t.time * 1000LL + t.millitm; } +// The following definitions "fake out" mingw to think that -mthreads +// was enabled and that mingwthr.dll was linked. GCJ-compiled +// applications don't need this helper library because we can safely +// detect thread death (return from Thread.run()). + +int _CRT_MT = 1; + +extern "C" int +__mingwthr_key_dtor (DWORD, void (*) (void *)) +{ + // FIXME: for now we do nothing; this causes a memory leak of + // approximately 24 bytes per thread created. + return 0; +} |