diff options
author | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-02-07 18:59:52 +0000 |
---|---|---|
committer | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-02-07 18:59:52 +0000 |
commit | dc5c09344a6ac8a625b2d0c5b2d2bbdbe0e96994 (patch) | |
tree | 445027a01135cb59b020bba496158a0fc253ef73 /libjava/win32.cc | |
parent | 9b2e8d38d4384c026086079b4a4b13662f719aac (diff) | |
download | gcc-dc5c09344a6ac8a625b2d0c5b2d2bbdbe0e96994.tar.gz |
* prims.cc (_Jv_CreateJavaVM): Call _Jv_platform_initialize.
* win32.cc (win32_exception_handler): Now static.
* include/win32.h (_Jv_platform_initialize): Declare.
(win32_exception_handler): Don't declare.
* java/lang/natSystem.cc (currentTimeMillis): Use
_Jv_platform_gettimeofday.
* posix.cc (_Jv_platform_gettimeofday): Renamed.
(_Jv_select): Use new name.
(_Jv_platform_initialize): New function.
* include/posix.h (_Jv_platform_gettimeofday): Renamed from
_Jv_gettimeofday.
(_Jv_platform_initialize): Declare.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@49583 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/win32.cc')
-rw-r--r-- | libjava/win32.cc | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/libjava/win32.cc b/libjava/win32.cc index daccf0f94fb..e54d926b0ef 100644 --- a/libjava/win32.cc +++ b/libjava/win32.cc @@ -9,9 +9,10 @@ Libgcj License. Please consult the file "LIBGCJ_LICENSE" for details. */ #include <config.h> -#include <windows.h> -LONG CALLBACK +#include "platform.h" + +static LONG CALLBACK win32_exception_handler (LPEXCEPTION_POINTERS e) { if (e->ExceptionRecord->ExceptionCode == EXCEPTION_ACCESS_VIOLATION) @@ -21,3 +22,16 @@ win32_exception_handler (LPEXCEPTION_POINTERS e) else return EXCEPTION_CONTINUE_SEARCH; } + +// Platform-specific VM initialization. +void +_Jv_platform_initialize (void) +{ + // Initialise winsock for networking + WSADATA data; + if (WSAStartup (MAKEWORD (1, 1), &data)) + MessageBox (NULL, "Error initialising winsock library.", "Error", + MB_OK | MB_ICONEXCLAMATION); + // Install exception handler + SetUnhandledExceptionFilter (win32_exception_handler); +} |