aboutsummaryrefslogtreecommitdiff
path: root/libjava/win32.cc
diff options
context:
space:
mode:
Diffstat (limited to 'libjava/win32.cc')
-rw-r--r--libjava/win32.cc23
1 files changed, 23 insertions, 0 deletions
diff --git a/libjava/win32.cc b/libjava/win32.cc
new file mode 100644
index 0000000..daccf0f
--- /dev/null
+++ b/libjava/win32.cc
@@ -0,0 +1,23 @@
+// win32.cc - Helper functions for Microsoft-flavored OSs.
+
+/* Copyright (C) 2002 Free Software Foundation
+
+ This file is part of libgcj.
+
+This software is copyrighted work licensed under the terms of the
+Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
+details. */
+
+#include <config.h>
+#include <windows.h>
+
+LONG CALLBACK
+win32_exception_handler (LPEXCEPTION_POINTERS e)
+{
+ if (e->ExceptionRecord->ExceptionCode == EXCEPTION_ACCESS_VIOLATION)
+ _Jv_ThrowNullPointerException();
+ else if (e->ExceptionRecord->ExceptionCode == EXCEPTION_INT_DIVIDE_BY_ZERO)
+ throw new java::lang::ArithmeticException;
+ else
+ return EXCEPTION_CONTINUE_SEARCH;
+}