From b8fe3c1e06a23f89a66d280c157fb44c738edbf2 Mon Sep 17 00:00:00 2001 From: Adam Megacz Date: Thu, 7 Feb 2002 05:26:42 +0000 Subject: [PATCH] configure.in: Changed mingw) to *mingw*). 2002-02-06 Adam Megacz * configure.in: Changed mingw) to *mingw*). * win32.cc: Created this file. * win32.h: Created this file. * win32.cc, prims.cc, win32.h (win32_exception_handler): Moved win32_exception_handler from prims.cc to win32.cc, added header in win32.h. * prims.cc: removed some #ifdef-WIN32'd headers which are no longer needed now that we have platform.h From-SVN: r49566 --- libjava/ChangeLog | 11 +++++++++++ libjava/configure | 6 +++--- libjava/configure.in | 6 +++--- libjava/include/win32.h | 22 ++++++++++++++++++++++ libjava/prims.cc | 28 +--------------------------- libjava/win32.cc | 23 +++++++++++++++++++++++ 6 files changed, 63 insertions(+), 33 deletions(-) create mode 100644 libjava/include/win32.h create mode 100644 libjava/win32.cc diff --git a/libjava/ChangeLog b/libjava/ChangeLog index 71bfac61f96..203c773eb76 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,14 @@ +2002-02-06 Adam Megacz + + * configure.in: Changed mingw) to *mingw*). + * win32.cc: Created this file. + * win32.h: Created this file. + * win32.cc, prims.cc, win32.h (win32_exception_handler): Moved + win32_exception_handler from prims.cc to win32.cc, added + header in win32.h. + * prims.cc: removed some #ifdef-WIN32'd headers which are no + longer needed now that we have platform.h + 2002-02-06 Adam Megacz * shs.h, shs.cc, natSimpleSHSStream.cc: use uint_t instead diff --git a/libjava/configure b/libjava/configure index d43c032a158..68cb751719f 100755 --- a/libjava/configure +++ b/libjava/configure @@ -2864,7 +2864,7 @@ fi PLATFORMOBJS= case "$TARGET_ECOS" in no) case "$host" in - mingw) + *mingw*) PLATFORM=Win32 PLATFORMOBJS=win32.lo PLATFORMH=win32.h @@ -3072,7 +3072,7 @@ test -d java/lang || mkdir java/lang case "${host}" in - mingw) + *mingw*) SYSTEMSPEC="-lgdi32 -lwsock32 -lws2_32" ;; *) @@ -6388,7 +6388,7 @@ case "${host}" in alpha*-*-linux*) SIGNAL_HANDLER=include/dwarf2-signal.h ;; - mingw) + *mingw*) SIGNAL_HANDLER=include/win32-signal.h ;; *) diff --git a/libjava/configure.in b/libjava/configure.in index 12f17756d92..f082f62e212 100644 --- a/libjava/configure.in +++ b/libjava/configure.in @@ -204,7 +204,7 @@ TARGET_ECOS="$with_ecos" PLATFORMOBJS= case "$TARGET_ECOS" in no) case "$host" in - mingw) + *mingw*) PLATFORM=Win32 PLATFORMOBJS=win32.lo PLATFORMH=win32.h @@ -250,7 +250,7 @@ AC_LINK_FILES(java/lang/${PLATFORM}Process.java, java/lang/ConcreteProcess.java) AC_LINK_FILES(java/lang/nat${PLATFORM}Process.cc, java/lang/natConcreteProcess.cc) case "${host}" in - mingw) + *mingw*) SYSTEMSPEC="-lgdi32 -lwsock32 -lws2_32" ;; *) @@ -852,7 +852,7 @@ case "${host}" in alpha*-*-linux*) SIGNAL_HANDLER=include/dwarf2-signal.h ;; - mingw) + *mingw*) SIGNAL_HANDLER=include/win32-signal.h ;; *) diff --git a/libjava/include/win32.h b/libjava/include/win32.h new file mode 100644 index 00000000000..677f5d34529 --- /dev/null +++ b/libjava/include/win32.h @@ -0,0 +1,22 @@ +// win32.h -- 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. */ + +#ifndef __JV_WIN32_H__ +#define __JV_WIN32_H__ + +#include +#undef STRICT + +#undef __INSIDE_CYGWIN__ +#include + +LONG CALLBACK win32_exception_handler (LPEXCEPTION_POINTERS e); + +#endif /* __JV_WIN32_H__ */ diff --git a/libjava/prims.cc b/libjava/prims.cc index ec6263caff0..995206cb16f 100644 --- a/libjava/prims.cc +++ b/libjava/prims.cc @@ -9,16 +9,7 @@ Libgcj License. Please consult the file "LIBGCJ_LICENSE" for details. */ #include - -#ifdef WIN32 -#include -#undef STRICT -#endif /* WIN32 */ - -#ifdef WIN32 -#undef __INSIDE_CYGWIN__ -#include -#endif /* WIN32 */ +#include #include #include @@ -731,23 +722,6 @@ _Jv_ThisExecutable (const char *name) } } -#ifdef WIN32 - -extern "C" int* win32_get_restart_frame (void *); - -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; -} - -#endif - #ifndef DISABLE_GETENV_PROPERTIES static char * diff --git a/libjava/win32.cc b/libjava/win32.cc new file mode 100644 index 00000000000..daccf0f94fb --- /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 +#include + +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; +}