Commit Graph

274 Commits

Author SHA1 Message Date
Mohan Embar 5c14415811 win32.cc: fixed tab...
* win32.cc: fixed tab, indentation and whitespace
	inconsistencies
	removed jvm.h include
	added includes java/lang/UnsupportedOperationException.h,
	java/io/IOException.h, java/net/SocketException.h
	(WSAEventWrapper): class implementation
	(_Jv_WinStrError): implemented both overloads
	(_Jv_ThrowIOException): implemented both overloads
	(_Jv_ThrowSocketException): implemented both overloads
	(_Jv_select): implemented
	* include/win32.h: fixed tab, indentation and whitespace
	inconsistencies
	wrapped <windows.h> include with  #define WIN32_LEAN_AND_MEAN
	added jvm.h include
	(WSAEventWrapper): added class declaration
	(_Jv_WinStrError): added both overload declarations
	(_Jv_ThrowIOException): added both overload declarations
	(_Jv_ThrowSocketException): added both overload declarations
	removed ENOTCONN, ECONNRESET and ENOPROTOOPT defines
	(_Jv_select): added declaration
	(_Jv_socket): removed
	(_Jv_connect): removed
	(_Jv_close): removed
	(_Jv_bind): removed
	(_Jv_accept): removed
	(_Jv_listen): removed
	(_Jv_write): removed
	(_Jv_read): removed
	* java/io/natFileDescriptorWin32.cc: fixed tab, indentation and
	whitespace inconsistencies
	replaced <windows.h> #include with <platform.h>
	removed jvm.h include
	(testCanUseGetHandleInfo): new function which tests whether Win32
	GetHandleInformation() call can be used with console buffer handles
	(only supported on >=WinNT 5.0)
	(winerr): removed (superseded by _Jv_WinStrError in include/win32.h)
	(valid): rewrote implementation using GetHandleInformation()
	(sync): 	changed exception throwing to use error string and exception
	helper methods declared in include/win32.h
	(open): likewise
	(write): likewise
	(setLength): likewise
	(close): likewise
	(seek): likewise
	(getFilePointer): likewise
	(read): likewise
	* java/io/natFileWin32.cc: fixed tab, indentation and
	whitespace inconsistencies
	replaced <windows.h> #include with <platform.h>
	removed jvm.h include
	(_access): use JV_TEMP_UTF_STRING
	(_stat): likewise
	(performMkDir): use JV_TEMP_UTF_STRING
	(performRenameTo): likewise
	(performDelete): likewise
	(performCreate): likewise
	(performSetReadOnly): likewise
	(performSetLastModified): likewise
	* java/lang/natWin32Process.cc: fixed tab, indentation and
	whitespace inconsistencies
	replaced <windows.h> #include with <platform.h>
	removed includes gcj/cni.h, jvm.h
	(new_string): removed
	(startProcess): use JV_TEMP_UTF_STRING,
	changed exception throwing to use error string and exception
	helper methods declared in include/win32.h
	* java/net/natInetAddressWin32.cc: fixed tab, indentation and
	whitespace inconsistencies
	replaced <windows.h> #include with <platform.h>
	removed jvm.h include
	removed DISABLE_JAVA_NET conditional code
	removed POSIX conditional code not relevant to Win32
	(aton): use JV_TEMP_UTF_STRING
	removed POSIX conditional code not relevant to Win32
	(lookup): likewise
	(getLocalHostName): likewise
	* java/net/natNetworkInterfaceWin32.cc: fixed tab, indentation and
	whitespace inconsistencies
	removed unnecessary windows.h, winsock.h and gcj/cni.h includes
	removed DISABLE_JAVA_NET conditional code
	removed POSIX conditional code not relevant to Win32
	(winsock2GetRealNetworkInterfaces): new function to compute network
	interfaces via Winsock2 API
	(determineGetRealNetworkInterfacesFN): new function for returning
	a function pointer to the function used to compute network interfaces.
	(getRealNetworkInterfaces): implemented
	* java/net/natPlainDatagramSocketImplWin32.cc: fixed tab, indentation and
	whitespace inconsistencies
	removed gcj/cni.h include
	removed DISABLE_JAVA_NET conditional code
	removed POSIX conditional code not relevant to Win32
	changed net POSIXisms to Win32isms
	replaced _Jv socket-related calls with their real Win32 equivalents
	changed exception throwing to use error string and exception
	helper methods declared in include/win32.h
	(peekData): implemented timeout support
	(receive): likewise
	* java/net/natPlainSocketImplWin32.cc: fixed tab, indentation and
	whitespace inconsistencies
	removed gcj/cni.h and gcj/javaprims.h includes
	removed DISABLE_JAVA_NET conditional code
	removed POSIX conditional code not relevant to Win32
	changed net POSIXisms to Win32isms
	replaced _Jv socket-related calls with their real Win32
	equivalents
	changed exception throwing to use error string and exception
	helper methods declared in include/win32.h
	(throwConnectException): helper function for connect()
	(connect): implemented timeout support
	(accept): likewise
	(doRead): new helper function common to both read() method overloads,
	includes timeout support
	(read): implemented both overloads in terms of doRead()
	(available): implemented using ioctlsocket()

From-SVN: r70904
2003-08-29 04:21:01 +00:00
Tom Tromey 91edd042ff Makefile.in: Rebuilt.
* Makefile.in: Rebuilt.
	* Makefile.am (ordinary_java_source_files): Added new files.
	* java/lang/Class.h (_Jv_sharedlib_register_hook): Declare as
	friend.
	* java/net/URLClassLoader.java (findClass): Don't use
	findURLResource.  Use loader's getClass method.
	(URLLoader.getClass): New method.
	(addURL): Handle `gcjlib' URLs.
	(SoURLLoader): New class.
	(SoResource): Likewise.
	* gnu/gcj/protocol/gcjlib/Connection.java: New file.
	* gnu/gcj/protocol/gcjlib/Handler.java: New file.
	* include/jvm.h (struct _Jv_core_chain): Moved from natCore.cc.
	(_Jv_RegisterCoreHook): Declare.
	(_Jv_FindCore): Declare.
	* gnu/gcj/runtime/SharedLibHelper.java: New file.
	* gnu/gcj/runtime/natSharedLibLoader.cc (CoreHookFunc): New
	typedef.
	(core_hook): New function.
	(struct SharedLibDummy) [saved_core]: New field.
	(init): Set _Jv_RegisterCoreHook.  Throw exception on failure.
	(register_hook): Set protection domain and class loader on new
	class.
	(finalize): Free core chain.
	* gnu/gcj/Core.java (Core): New constructor.
	* gnu/gcj/runtime/SharedLibLoader.java: Rewrote to use
	SharedLibHelper.
	* gnu/gcj/natCore.cc (_Jv_RegisterResource): Indentation fixlet.
	(_Jv_create_core): New function.
	(create): Use it.
	(default_register_resource): New function.
	(_Jv_RegisterCoreHook): New global.
	(_Jv_RegisterResource): Use it.
	(core_chain_struct): Removed.
	(_Jv_FindCore): New function.
	(_Jv_FreeCoreChain): New function.

From-SVN: r70892
2003-08-28 22:17:37 +00:00
Scott Gilbertson c79c6c5b9e Makefile.am (gtk_awt_peer_sources): Add gnu/java/awt/peer/GLightweightPeer.java.
2003-08-21  Scott Gilbertson  <scottg@mantatest.com>
            Thomas Fitzsimmons  <fitzsim@redhat.com>

	* Makefile.am (gtk_awt_peer_sources): Add
	gnu/java/awt/peer/GLightweightPeer.java.  Remove
	gnu/java/awt/GLightweightPeer.java.
	* gnu/java/awt/GLightweightPeer.java: Remove file.
	* gnu/java/awt/peer/GLightweightPeer.java: New file.
	* java/awt/Component.java (getToolkit): Add comment about
	lightweight components.
	* java/awt/Toolkit.java (createComponent): Return
	gnu.java.awt.peer.GLightweightPeer.

Co-Authored-By: Thomas Fitzsimmons <fitzsim@redhat.com>

From-SVN: r70657
2003-08-21 18:39:56 +00:00
Mohan Embar dca5e0e850 jvm.h: New class _Jv_TempUTFString (helper class for getting a temporary C string from...
* include/jvm.h: New class _Jv_TempUTFString (helper class for
	getting a temporary C string from a jstring)
	New macro JV_TEMP_UTF_STRING, which leverages _Jv_TempUTFString
	but uses a stack buffer if the string length is less than 256
	bytes.

From-SVN: r70564
2003-08-19 11:48:59 +00:00
Tom Tromey 0da021f5cc re PR libgcj/11951 (natMethod.cc (_Jv_CallAnyMethodA) should clear ffi_result before ffi_call)
PR libgcj/11951:
	* java/lang/reflect/natMethod.cc (_Jv_CallAnyMethodA): Returns
	void.  Throw VirtualMachineError if ffi fails.  Initialize return
	value.  Added is_jni_call argument; only wrap exception if not a
	JNI call.  Use descriptive message if operation not supported.
	(_Jv_GetTypesFromSignature): Use declaring class' loader to find
	array class.
	* include/jvm.h (_Jv_CallAnyMethodA): Updated declaration.
	* jni.cc (_Jv_JNI_CallAnyMethodV): Updated for new form of
	_Jv_CallAnyMethodA.
	(_Jv_JNI_CallAnyMethodA): Likewise.
	(_Jv_JNI_CallAnyVoidMethodV): Likewise.
	(_Jv_JNI_CallAnyVoidMethodA): Likewise.

From-SVN: r70544
2003-08-18 14:36:07 +00:00
Andrew Haley cf68fdb19b i386-signal.h (RESTORE): New.
2003-07-08  Andrew Haley  <aph@redhat.com>

        * include/i386-signal.h (RESTORE): New.
        (INIT_SEGV): Set restorer.
        (INIT_FPE): Likewise.

From-SVN: r69957
2003-07-30 14:50:02 +00:00
Tom Tromey ffd94572f4 Runtime.java: Comment fix.
* java/lang/Runtime.java: Comment fix.
	* java/lang/ClassLoader.java (isAncestorOf): New method.
	(getParent): Uncommented security check.  Use isAncestorOf.
	* include/jvm.h (_Jv_CheckAccess): Declare.
	* java/lang/reflect/natConstructor.cc (newInstance): Perform
	access check.
	Include IllegalAccessException.h, ArrayIndexOutOfBoundsException.h.
	* java/lang/reflect/natArray.cc (newInstance): Pass caller's
	class loader to _Jv_GetArrayClass.
	Include ArrayIndexOutOfBoundsException.h.
	* java/lang/reflect/Field.java: Update comment to reflect status.
	(equals): Fixed indentation.
	* java/lang/Class.h (Class): Declare memberAccessCheck, not
	checkMemberAccess.  Make _Jv_CheckAccess a friend.
	* java/lang/Class.java (memberAccessCheck): New method from
	Classpath.
	(checkMemberAccess): Removed.
	(getDeclaredMethod): Use memberAccessCheck.
	(getField): Likewise.
	(getMethod): Likewise.
	* resolve.cc (_Jv_ResolvePoolEntry): Use _Jv_CheckAccess.
	(_Jv_SearchMethodInClass): Likewise.
	* prims.cc (_Jv_CheckAccess): New function.
	* jni.cc (_Jv_JNI_FindClass): Use getClassLoaderInternal.
	(_Jv_JNI_GetAnyFieldID): Likewise.
	* java/lang/natClass.cc (forName): Use getClassLoaderInternal.
	(getClassLoader): Added security check.
	(getConstructor): Call memberAccessCheck.
	(getDeclaredClasses): Likewise.
	(getDeclaredField): Likewise.
	(getDeclaredFields): Likewise.
	(_getConstructors): Likewise.
	(getDeclaredConstructor): Likewise.
	(getDeclaredMethods): Likewise.
	(getFields): Likewise.
	(getMethods): Likewise.
	(newInstance): Likewise.
	(_Jv_MakeVTable): Put method name in exception.
	* java/lang/reflect/natMethod.cc (getType): Use
	getClassLoaderInternal.
	(_Jv_GetTypesFromSignature): Likewise.
	(invoke): Perform access check.
	(_Jv_CallAnyMethodA): Removed old FIXME comments.
	Include ArrayIndexOutOfBoundsException.h.
	* java/lang/reflect/natField.cc (getType): Use
	getClassLoaderInternal.
	(_Jv_CheckFieldAccessibility): Removed.
	(getAddr): Use _Jv_CheckAccess; find caller.
	Include ArrayIndexOutOfBoundsException.h.

From-SVN: r69621
2003-07-21 01:54:06 +00:00
Rainer Orth 6b3517eaf5 configure.in: Check for usleep declaration.
* configure.in: Check for usleep declaration.
	* acconfig.h (HAVE_USLEEP_DECL): Provide template.
	* configure: Regenerate.
	* include/config.h.in: Likewise.
	* include/posix.h [!HAVE_USLEEP_DECL]: Declare usleep.

From-SVN: r69041
2003-07-07 14:11:09 +00:00
Thomas Fitzsimmons 29e531ff29 glib-2.0.m4: New file.
* glib-2.0.m4: New file.
	* gtk-2.0.m4: New file.
	* glib.m4: Remove.
	* gtk.m4: Remove.
	* configure.in: Update AM_PATH_GTK macro call to
	AM_PATH_GTK_2_0.  Likewise for AM_PATH_GLIB.
	* jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics.c,
	jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c,
	jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c,
	jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c,
	jni/gtk-peer/gnu_java_awt_peer_gtk_GtkListPeer.c,
	jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMainThread.c,
	jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollBarPeer.c,
	jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextAreaPeer.c,
	jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextComponentPeer.c,
	jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextFieldPeer.c,
	jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c,
	jni/gtk-peer/gthread-jni.c,
	jni/gtk-peer/gthread-jni.h:
	New versions from classpath.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.
	* Makefile.in: Regenerate.
	* gcj/Makefile.in: Regenerate.
	* include/Makefile.in: Regenerate.
	* testsuite/Makefile.in: Regenerate.

From-SVN: r68746
2003-06-30 23:53:29 +00:00
Franz Sirl 7d8b7202f8 Oops, accidentally committed the 3.3 version to mainline. Undone.
From-SVN: r68156
2003-06-18 15:29:12 +00:00
Franz Sirl beea232412 powerpc-signal.h: New File.
2003-06-17  Franz Sirl  <Franz.Sirl-kernel@lauterbach.com>

	* include/powerpc-signal.h: New File.
	* configure.in: Use it.
	* configure: Regenerated.

From-SVN: r68088
2003-06-17 15:56:09 +00:00
Andrew Haley bec3e66d1a prims.cc (catch_segv): Create exception in handler.
2003-06-12  Andrew Haley  <aph@redhat.com>

        * prims.cc (catch_segv): Create exception in handler.
        (catch_fpe): Likewise.
        (_Jv_divI, _Jv_remI, _Jv_divJ, _Jv_remJ): Likewise.
        (_Jv_ThrowSignal): Remove.

        * include/x86_64-signal.h (INIT_SEGV): Delete reference to nullp.
        * include/default-signal.h (INIT_SEGV, INIT_FPE): Delete reference
        to nullp and arithexception.
        * include/dwarf2-signal.h (INIT_SEGV, INIT_FPE): Likewise.
        * include/i386-signal.h (INIT_SEGV, INIT_FPE): Likewise.
        * include/s390-signal.h (INIT_SEGV, INIT_FPE): Likewise.
        * include/sparc-signal.h (INIT_SEGV, INIT_FPE): Likewise.
        * include/win32-signal.h (INIT_SEGV, INIT_FPE): Likewise.

From-SVN: r67892
2003-06-13 12:20:45 +00:00
Michael Koch 248e983efb 2003-06-07 Michael Koch <konqueror@gmx.de>
* include/posix.h
	(O_DSYNC): Define O_DSYNC on platforms not
	supporting O_FSYNC (newlib).

From-SVN: r67587
2003-06-07 14:30:32 +00:00
Loren J. Rittle 49c72d225b posix.h (O_SYNC): Define if not available and a reasonable...
* libjava/include/posix.h (O_SYNC): Define if not available
	and a reasonable, perhaps more conservative, replacement exists.
	(O_DSYNC): Likewise.
	* java/io/natFileDescriptorPosix.cc (open): Revert last patch.

From-SVN: r67517
2003-06-05 22:37:02 +00:00
Bert Deknuydt ad23ad2cbe posix-threads.h: Include <machine/pal.h> on OSF.
2003-06-05  Bert Deknuydt  <Bert.Deknuydt@esat.kuleuven.ac.be>

	* include/posix-threads.h: Include <machine/pal.h> on OSF.

From-SVN: r67491
2003-06-05 15:43:58 +00:00
Andrew Haley 9f47031337 x86_64-signal.h (MAKE_THROW_FRAME): Mark sigcontext on stack volatile to prevent optimization from removing it.
2003-06-03  Andrew Haley  <aph@redhat.com>

        * include/x86_64-signal.h (MAKE_THROW_FRAME): Mark sigcontext on
        stack volatile to prevent optimization from removing it.

From-SVN: r67379
2003-06-03 16:13:22 +00:00
Mohan Embar c4519773ca jvm.h: (_Jv_GetNbArgs) added (_Jv_GetSafeArg) added (_Jv_SetArgs) added
2003-03-29  Mohan Embar  <gnustuff@thisiscool.com>

        * include/jvm.h: (_Jv_GetNbArgs) added
        (_Jv_GetSafeArg) added
        (_Jv_SetArgs) added
        * prims.cc: (_Jv_GetNbArgs) implemented
        (_Jv_GetSafeArg) implemented
        (_Jv_SetArgs) implemented
        (_Jv_RunMain) use _Jv_SetArgs() instead of explicitly
        setting _Jv_argc and _Jv_argv
        * posix.cc: (_Jv_ThisExecutable) use _Jv_GetSafeArg()
        instead of _Jv_argv
        * java/lang/natRuntime.cc: (insertSystemProperties) use
        _Jv_GetSafeArg() instead of _Jv_argv

From-SVN: r66067
2003-04-25 16:48:13 +00:00
Andreas Tobler dcde977582 posix.h: Add suffix for darwin dynamic libraries.
2003-03-22  Andreas Tobler <a.tobler@schweiz.ch>

        * include/posix.h: Add suffix for darwin dynamic libraries.

From-SVN: r64705
2003-03-22 11:56:44 +01:00
Tom Tromey 2b7f1f8f41 resolve.cc (ncode): Use _Jv_platform_ffi_abi.
* resolve.cc (ncode): Use _Jv_platform_ffi_abi.
	Include platform.h.
	* java/lang/natRuntime.cc (insertSystemProperties): Use
	_Jv_platform_path_separator.
	(nativeGetLibname): Use _Jv_platform_file_separator.
	(_load): Use _Jv_platform_onload_names.
	(onload_names): New global.
	* include/win32.h (_Jv_platform_file_separator): New define.
	(_Jv_platform_path_separator): Likewise.
	(_Jv_platform_onload_names): Likewise.
	(_Jv_platform_ffi_abi): Likewise.
	* include/posix.h (_Jv_platform_file_separator): New define.
	(_Jv_platform_path_separator): Likewise.
	(_Jv_platform_onload_names): Likewise.
	(_Jv_platform_ffi_abi): Likewise.

From-SVN: r64461
2003-03-17 00:45:37 +00:00
Andrew Haley c068c63834 [multiple changes]
2003-03-10  2003-02-27  Mohan Embar  <gnustuff@thisiscool.com>

        * include/jvm.h: removed declaration of _Jv_ThisExecutable()
        setter; made return value of getter const char* instead of char*
        * prims.cc: removed all references to _Jv_ThisExecutable().
        These are in the platform-specific sections now.
        * posix.cc: define platform-specific _Jv_ThisExecutable().
        Handle DISABLE_MAIN_ARGS and HAVE_PROC_SELF_EXE cases
        * win32.cc: define platform-specific _Jv_ThisExecutable()
        using GetModuleFilename()
        * java/lang/natRuntime.cc: set gnu.gcj.progname property
        to argv[0] instead of _Jv_ThisExecutable()

2003-03-10  Ranjit Mathew  <rmathew@hotmail.com>

        * gnu/gcj/runtime/NameFinder.java (usingAddr2name): New flag
        that is set if we are using addr2name.awk instead of addr2line.
        (NameFinder): Set usingAddr2name if using addr2name.awk.
        (getExternalLabel): New native method to convert a method
        name to an external label.
        (lookup): Convert name given by addr2line to an external label
        before demangling.

        * gnu/gcj/runtime/natNameFinder.cc (LABEL_PREFIX): New string
        constant representing the prefix attached to method names to
        convert them to an external label.
        (gnu::gcj::runtime::NameFinder::getExternalLabel): Define
        using LABEL_PREFIX.

From-SVN: r64111
2003-03-10 19:45:30 +00:00
Michael Koch c0daa90283 configure.in: Added check for memory mapping of files.
2003-03-02  Michael Koch  <konqueror@gmx.de>

	* configure.in: Added check for memory mapping of files.
	* configure: Regenerated.
	* config.h.in: Regenerated.

From-SVN: r63661
2003-03-02 13:46:06 +00:00
Tom Tromey cf88ede3d2 Makefile.in: Rebuilt.
* Makefile.in: Rebuilt.
	* Makefile.am (JC1FLAGS): Added -Wno-deprecated.

From-SVN: r63352
2003-02-24 02:15:43 +00:00
Rainer Orth a191802c42 natStackTrace.cc: Include platform.h immediately after config.h.
* gnu/gcj/runtime/natStackTrace.cc: Include platform.h immediately
	after config.h.  Use <> for consistency.
	* java/lang/natObject.cc: Likewise.
	* java/lang/natRuntime.cc: Likewise.
	* java/lang/natSystem.cc: Likewise.
	* java/util/natTimeZone.cc: Likewise.
	* win32.cc: Likewise.
	* include/posix.h (fcntl, socket, connect, close, bind, accept,
	listen, write, read): Undef to avoid interference from OS macros.

From-SVN: r63122
2003-02-19 16:28:37 +00:00
Ranjit Mathew ea5a63a26d win32.h: Include ws2tcpip.h instead of winsock.h to obtain definition of the socklen_t type.
2003-02-12  Ranjit Mathew  <rmathew@hotmail.com>

	* include/win32.h: Include ws2tcpip.h instead of
	winsock.h to obtain definition of the socklen_t type.
	Remove IP_TOS definition - not needed with ws2tcpip.h
	(_Jv_connect): Correct slight formatting error.

From-SVN: r62801
2003-02-13 00:07:37 +00:00
Tom Tromey 60c7f4ef5e aclocal.m4, [...]: Rebuilt.
* aclocal.m4, configure, include/config.h.in: Rebuilt.
	* acinclude.m4 (CHECK_FOR_BROKEN_MINGW_LD): Resurrected; was in
	aclocal.m4 and lost in some merge.

From-SVN: r62188
2003-01-31 17:59:00 +00:00
Tom Tromey 5aac1dac62 Window.java (Window(Window,GraphicsConfiguration)): Don't try to find graphics configuration.
* java/awt/Window.java (Window(Window,GraphicsConfiguration)):
	Don't try to find graphics configuration.
	* java/awt/Toolkit.java (default_toolkit_name): Use new
	Configuration entry.
	* gnu/classpath/Configuration.java.in (default_awt_peer_toolkit):
	New global.
	* configure: Rebuilt.
	* configure.in (TOOLKIT): New subst.
	(--enable-java-awt) [xlib, gtk]: Set TOOLKIT if required.
	Do AWT tests much earlier.  Run Gtk tests.  Make jniinclude
	directory.  Make output directories for .c files.
	* Makefile.in: Rebuilt.
	* Makefile.am (lib_gnu_java_awt_peer_gtk_la_SOURCES): New macro.
	(toolexeclib_LTLIBRARIES): Added cond_gtk_ltlibrary.
	(all_java_source_files): Added new sources.
	($(lib_gnu_java_awt_peer_gtk_la_OBJECTS)): New target.
	(gtk_c_files): New macro.
	(gtk_c_source_files): New macro.
	(cond_gtk_ltlibrary): New macro.
	($(gtk_c_files)): New target.
	(lib_gnu_java_awt_peer_gtk_la_LIBADD): New macro.
	(gtk_awt_peer_sources): New macro.
	(gtk_c_headers): New macro.
	($(gtk_c_headers)): New target.
	(ACLOCAL_AMFLAGS): New macro.
	* gtk.m4, glib.m4, libart.m4: New files.
	* gnu/java/awt/peer/gtk/GdkFontMetrics.java,
	gnu/java/awt/peer/gtk/GdkGraphics.java,
	gnu/java/awt/peer/gtk/GtkArg.java,
	gnu/java/awt/peer/gtk/GtkArgList.java,
	gnu/java/awt/peer/gtk/GtkButtonPeer.java,
	gnu/java/awt/peer/gtk/GtkCanvasPeer.java,
	gnu/java/awt/peer/gtk/GtkCheckboxGroupPeer.java,
	gnu/java/awt/peer/gtk/GtkCheckboxMenuItemPeer.java,
	gnu/java/awt/peer/gtk/GtkCheckboxPeer.java,
	gnu/java/awt/peer/gtk/GtkChoicePeer.java,
	gnu/java/awt/peer/gtk/GtkClipboard.java,
	gnu/java/awt/peer/gtk/GtkComponentPeer.java,
	gnu/java/awt/peer/gtk/GtkContainerPeer.java,
	gnu/java/awt/peer/gtk/GtkDialogPeer.java,
	gnu/java/awt/peer/gtk/GtkFileDialogPeer.java,
	gnu/java/awt/peer/gtk/GtkFontPeer.java,
	gnu/java/awt/peer/gtk/GtkFramePeer.java,
	gnu/java/awt/peer/gtk/GtkGenericPeer.java,
	gnu/java/awt/peer/gtk/GtkImage.java,
	gnu/java/awt/peer/gtk/GtkImagePainter.java,
	gnu/java/awt/peer/gtk/GtkLabelPeer.java,
	gnu/java/awt/peer/gtk/GtkListPeer.java,
	gnu/java/awt/peer/gtk/GtkMainThread.java,
	gnu/java/awt/peer/gtk/GtkMenuBarPeer.java,
	gnu/java/awt/peer/gtk/GtkMenuComponentPeer.java,
	gnu/java/awt/peer/gtk/GtkMenuItemPeer.java,
	gnu/java/awt/peer/gtk/GtkMenuPeer.java,
	gnu/java/awt/peer/gtk/GtkOffScreenImage.java,
	gnu/java/awt/peer/gtk/GtkPanelPeer.java,
	gnu/java/awt/peer/gtk/GtkPopupMenuPeer.java,
	gnu/java/awt/peer/gtk/GtkScrollbarPeer.java,
	gnu/java/awt/peer/gtk/GtkScrollPanePeer.java,
	gnu/java/awt/peer/gtk/GtkTextAreaPeer.java,
	gnu/java/awt/peer/gtk/GtkTextComponentPeer.java,
	gnu/java/awt/peer/gtk/GtkTextFieldPeer.java,
	gnu/java/awt/peer/gtk/GtkToolkit.java,
	gnu/java/awt/peer/gtk/GtkWindowPeer.java,
	gnu/java/awt/peer/gtk/TestAWT.java,
	gnu/java/awt/peer/gtk/Test.java: New files from Classpath.
	* jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontMetrics.c,
	jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics.c,
	jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c,
	jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCanvasPeer.c,
	jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxMenuItemPeer.c,
	jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxPeer.c,
	jni/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.c,
	jni/gtk-peer/gnu_java_awt_peer_gtk_GtkClipboard.c,
	jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c,
	jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c,
	jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFileDialogPeer.c,
	jni/gtk-peer/gnu_java_awt_peer_gtk_GtkImagePainter.c,
	jni/gtk-peer/gnu_java_awt_peer_gtk_GtkLabelPeer.c,
	jni/gtk-peer/gnu_java_awt_peer_gtk_GtkListPeer.c,
	jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMainThread.c,
	jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuBarPeer.c,
	jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuItemPeer.c,
	jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuPeer.c,
	jni/gtk-peer/gnu_java_awt_peer_gtk_GtkPanelPeer.c,
	jni/gtk-peer/gnu_java_awt_peer_gtk_GtkPopupMenuPeer.c,
	jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollBarPeer.c,
	jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollPanePeer.c,
	jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextAreaPeer.c,
	jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextComponentPeer.c,
	jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextFieldPeer.c,
	jni/gtk-peer/gnu_java_awt_peer_gtk_GtkToolkit.c,
	jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c,
	jni/gtk-peer/gthread-jni.c, jni/gtk-peer/gthread-jni.h,
	jni/gtk-peer/gtkpeer.h, jni/classpath/jcl.c, jni/classpath/jcl.h,
	jni/classpath/jnilink.c, jni/classpath/jnilink.h,
	jni/classpath/native_state.c, jni/classpath/native_state.h,
	jni/classpath/primlib.c, jni/classpath/primlib.h: Likewise.

From-SVN: r62187
2003-01-31 17:54:14 +00:00
Ranjit Mathew 65b8e87409 re PR java/9254 (java::lang::Object::wait(), threads-win32.cc returns wrong return codes)
2003-01-28  Ranjit Mathew  <rmathew@hotmail.com>

	Fixes PR java/9254:
	* include/win32-threads.h (_Jv_Mutex_t): Convert to a struct
	additionally containing id of the owner thread as well as
	the number of nested times the thread has acquired the mutex.
	(_Jv_MutexInit): Initialise owner thread id and refcount to 0.
	(_Jv_MutexDestroy): Reset owner thread id and refcount to 0.
	(_Jv_MutexUnlock): Check if really the owner thread, reset
	owner thread id to 0 before leaving, if leaving for the last
	time.
	(_Jv_MutexLock): Set owner thread id in the mutex and increment
	refcount.
	(_Jv_ThreadYield): Yield using a call to Sleep(0).
	* win32-threads.cc (_Jv_CondWait): Check if really owner of
	the passed mutex.
	Pass handle of the broadcast event, instead of a pointer to it
	in Win32 ResetEvent( ) call.
	Remove incorrect return values.
	(_Jv_CondDestroy): Close both event handles and delete
	critical section.
	(_Jv_CondNotify): Check if really the owner thread.
	(_Jv_CondNotifyAll): Check if really the owner thread.
	(_Jv_InitThreads): Change daemon_cond to a manual-reset event.
	(really_start): Use SetEvent( ) to signal daemon_cond.
	(_Jv_ThreadWait): Remove SignalObjectAndWait( ) and use
	WaitForSingleObject( ) instead to wait for daemon_cond to be
	signalled.

From-SVN: r62033
2003-01-28 22:23:36 +00:00
Ranjit Mathew e4261ef72c configure.in: Specifically define HAVE_BACKTRACE if building for MinGW.
2003-01-27  Ranjit Mathew  <rmathew@hotmail.com>

	* configure.in: Specifically define HAVE_BACKTRACE if building
	for MinGW.
	* include/win32.h: Remove HAVE_BACKTRACE definition.
	* gnu/gcj/runtime/natStackTrace.cc: Include platform.h.
	* configure: Rebuilt.

From-SVN: r62000
2003-01-28 19:10:00 +00:00
Tom Tromey 4c98b1b078 defineclass.cc (handleMethodsEnd): Precompute code for static method.
* defineclass.cc (handleMethodsEnd): Precompute code for static
	method.
	(handleCodeAttribute): Likewise.
	* resolve.cc (ncode): Use run_class for unsynchronized static
	methods.
	* include/java-interp.h (class _Jv_InterpMethod): Declare
	run_class.
	* interpret.cc (run_synch_class): Initialize class.
	(run) [insn_invokestatic]: Don't initialize class.
	[insn_anewarray]: Likewise.
	[insn_multianewarray]: Likewise.
	(run_class): New function.

From-SVN: r61727
2003-01-24 19:58:21 +00:00
Andrew Haley f8061f6ab4 x86_64-signal.h: Add simple handler for x86_64 32-bit mode.
2003-01-22  Andrew Haley  <aph@redhat.com>

        * x86_64-signal.h: Add simple handler for x86_64 32-bit mode.
        * configure.host (CHECKREFSPEC): Define for x86_64.

From-SVN: r61600
2003-01-22 17:47:04 +00:00
Andrew Haley b399dfb0b4 dwarf2-signal.h: Remove x86_64.
2003-01-10  Andrew Haley  <aph@redhat.com>

        * include/dwarf2-signal.h: Remove x86_64.
        * configure.host (x86_64 DIVIDESPEC): Remove.
        * include/x86_64-signal.h: New file.
        * configure.in: Regenerate.

From-SVN: r61285
2003-01-14 14:02:13 +00:00
Andrew Haley 399df6db87 dwarf2-signal.h: Remove x86_64.
2003-01-10  Andrew Haley  <aph@redhat.com>

        * include/dwarf2-signal.h: Remove x86_64.
        * configure.host (x86_64 DIVIDESPEC): Remove.
        * include/x86_64-signal.h: New file.
        * configure.in: Regenerate.

From-SVN: r61284
2003-01-14 13:51:15 +00:00
Tom Tromey 6ec628973a posix.h (_Jv_platform_usleep): Wrap in ifdef JV_HASH_SYNCHRONIZATION.
* include/posix.h (_Jv_platform_usleep): Wrap in ifdef
	JV_HASH_SYNCHRONIZATION.
	* include/win32.h (_Jv_platform_usleep): Wrap in ifdef
	JV_HASH_SYNCHRONIZATION.

From-SVN: r60998
2003-01-07 16:50:08 +00:00
Tom Tromey 35a94bdca8 re PR libgcj/8997 (spin() calls Thread.sleep)
2002-12-31  Tom Tromey  <tromey@redhat.com>
            Ranjit Mathew  <rmathew@hotmail.com>

	Fix for PR libgcj/8997:
	* java/lang/natObject.cc (spin): Use _Jv_platform_usleep.
	Include platform.h.
	* include/posix.h (_Jv_platform_usleep): New function.
	* include/win32.h (_Jv_platform_usleep): New function.

Co-Authored-By: Ranjit Mathew <rmathew@hotmail.com>

From-SVN: r60700
2002-12-31 17:43:47 +00:00
Mark Mitchell dfe5a36e95 boehm.cc: Remove stray semicolon.
* boehm.cc: Remove stray semicolon.
	* interpret.cc: Likewise.
	* prims.cc: Likewise.
	* verify.cc (_Jv_BytecodeVerifier::verify_fail): Move definition
	earlier to ensure default arguments are processed.
	* gcj/array.h (JArray): Add forward declaration.
	(elements): Likewise.
	* gcj/javaprim.h: Remove stray semicolons.
	* include/bohm-gc.h: Likewise.
	* include/jni.h: Likewise.
	* include/jvm.h: Likewise.
	* java/lang/Class.h (_Jv_GetArrayClass): Declare _Jv_NewArrayClass.

From-SVN: r60556
2002-12-28 06:38:52 +00:00
Tom Tromey a1aba4f9a5 natClassLoader.cc (defineClass0): Removed erroneous comment.
* java/lang/natClassLoader.cc (defineClass0): Removed erroneous
	comment.
	* java/lang/ClassLoader.java (defineClass): Use chained
	exception when rethrowing.
	* defineclass.cc (handleClassBegin): Mark class as interpreted.
	* java/lang/reflect/Modifier.java (INVISIBLE, INTERPRETED): New
	constants.
	* resolve.cc (_Jv_PrepareMissingMethods): New function.
	(_Jv_PrepareClass): Use it.
	* include/java-interp.h (_Jv_IsInterpretedClass): Rewrote.
	(_Jv_InterpClass): _Jv_PrepareMissingMethods now friend.
	* java/lang/Class.h (Class::getModifiers): Mask with ALL_FLAGS.
	(Class): _Jv_PrepareMissingMethods now friend.
	* java/lang/natClassLoader.cc (defineClass0): Use JvSynchronize.
	Record `NULL' for system class loader.
	(_Jv_RegisterInitiatingLoader): Use JvSynchronize.  Special case
	system class loader.
	(_Jv_FindClassInCache): Likewise.
	(_Jv_UnregisterClass): Use JvSynchronize.  Free old loader info.
	(_Jv_FindClass): Special case system class loader.
	* java/lang/natClass.cc (_Jv_abstractMethodError): New function.
	(_Jv_SetVTableEntries): Put _Jv_abstractMethodError into empty
	vtable slots.
	(_Jv_LayoutVTableMethods): Don't generate vtable slot for a method
	in a final class.
	(_getDeclaredMethod): Don't return synthetic methods.
	(getDeclaredMethods): Likewise.
	(_getMethod): Likewise.
	(_getMethods): Likewise.

From-SVN: r60319
2002-12-19 19:31:55 +00:00
Tom Tromey 35cfd29184 win32.h: Fixed typo in "DISABLE_JAVA_NET".
* include/win32.h: Fixed typo in "DISABLE_JAVA_NET".
	From Laurent Bardet <l.bardet@magic.fr>.

From-SVN: r60013
2002-12-10 21:24:47 +00:00
Tom Tromey 78bb0444d2 win32.h (_Jv_platform_solib_prefix): New define.
* include/win32.h (_Jv_platform_solib_prefix): New define.
	(_Jv_platform_solib_suffix): Likewise.
	* include/posix.h (_Jv_platform_solib_prefix): New define.
	(_Jv_platform_solib_suffix): Likewise.
	* java/lang/natRuntime.cc: Include StackTrace.h.
	(_load): Use findLibrary and new platform defines.
	(nativeGetLibname): Use new platform defines.

From-SVN: r59976
2002-12-10 01:39:32 +00:00
Tom Tromey b4d0051bd9 java-interp.h (class _Jv_InterpMethod): Added JV_MARKOBJ_DECL.
* include/java-interp.h (class _Jv_InterpMethod): Added
	JV_MARKOBJ_DECL.
	* boehm.cc (_Jv_MarkObj): Consolidated interpreter code.  Also
	mark `prepared' field of interpreted method.
	* interpret.cc (compile): Use _Jv_AllocBytes.

From-SVN: r59900
2002-12-06 23:41:38 +00:00
Andrew Haley 421f9e6091 natClassLoader.cc (_Jv_PrepareCompiledClass): Call _Jv_PushClass.
2002-12-03  Andrew Haley  <aph@redhat.com>

        * java/lang/natClassLoader.cc (_Jv_PrepareCompiledClass): Call
	_Jv_PushClass.
        (_Jv_InitNewClassFields): Set protectionDomain and chain = NULL.
        (_Jv_PopClass): New.
        (_Jv_PushClass): New.
        * java/lang/natClass.cc (forName (jstring)): Use a StackTrace to
        discover the ClassLoader of our caller.
        (_Jv_CheckArrayStore): Don't check that a class is assignment
        compatible with Object.
        * java/lang/natVMTHrowable.cc: Delete.
        * gnu/gcj/runtime/StackTrace.java: New, partly copied from
	java.lang.VMThrowable.
        (StackTrace(), StackTrace(int)): New constructors.
        (classAt, methodAt, update, methodAtAddress): New methods.
        (map): New field.
	* java/lang/VMThrowable.java: Use StackTrace instead of
	natVMTHrowable.
	* java/lang/Class.h (getClassLoaderInternal): New.
        (class Class): Be friendly with _Jv_PopClass and _Jv_PushClass.
        Be friendly with gnu::gcj::runtime::StackTrace.
        (Object.chain): New field.
        * include/java-interp.h (class _Jv_InterpMethod): Be friendly with
        gnu::gcj::runtime::StackTrace.
        * prims.cc (_Jv_NewObjectArray): Use getClassLoaderInternal()
        instead of getClassLoader().
        * verify.cc (class _Jv_BytecodeVerifier): Likewise.
        java::lang::VMThrowable.
        * Makefile.am (core_java_source_files): Add MethodRef.java,
	StackTrace.java.
        (nat_source_files): Remove natVMThrowable.cc; add natStackTrace.cc.
        * Makefile.in: Rebuild.

2002-12-03  Andrew Haley  <aph@redhat.com>

	* class.c (make_class_data): New field, "chain".
	* decl.c (java_init_decl_processing): Likewise.

From-SVN: r59769
2002-12-03 13:50:05 +00:00
Tom Tromey 35e058a2b8 jni.cc: Added `name' argument.
* jni.cc: Added `name' argument.
	* include/jni.h (struct JNINativeInterface) [DefineClass]: Added
	`const char *' argument.
	(class _Jv_JNIEnv) [DefineClass]: Likewise.

From-SVN: r59756
2002-12-03 03:54:05 +00:00
Andreas Tobler 32e098dd98 natPlainDatagramSocketImpl.cc (socklen_t): Don't define.
2002-11-26  Andreas Tobler  <a.tobler@schweiz.ch>

	* java/net/natPlainDatagramSocketImpl.cc (socklen_t): Don't
	define.
	* java/net/natPlainSocketImpl.cc (socklen_t): Don't define.
	* include/posix.h (socklen_t): Define if not already defined.

From-SVN: r59533
2002-11-26 20:09:28 +00:00
Michael Koch c6d58c6682 2002-11-22 Michael Koch <konqueror@gmx.de>
* include/posix.h:
	(_Jv_platform_on_close): Moved out of #ifndef DISBALE_JAVA_NET.
	* include/win32.h:
	(_Jv_platform_on_close): Moved out of #ifndef DISBALE_JAVA_NET.
	(backtrace): Moved out of #ifndef DISBALE_JAVA_NET.

From-SVN: r59374
2002-11-22 10:27:53 +00:00
Michael Koch d1bf262d83 posix.h: I put too much into the #ifndef DISABLE_JAVA_NET.
2002-11-21  Michael Koch <konqueror@gmx.de>

        * include/posix.h: I put too much into the #ifndef DISABLE_JAVA_NET.
        Only the new network functions should be in it.

From-SVN: r59350
2002-11-21 18:01:22 +00:00
Michael Koch e59ff7e93a posic.h: Moved new functions into a #ifndef DISABLE_JAVA_NET
2002-11-21  Michael Koch <konqueror@gmx.de>

	* include/posic.h: Moved new functions into a #ifndef DISABLE_JAVA_NET
	* include/win32.h: Moved new functions into a #ifndef DISABLE_JAVA_NET

From-SVN: r59346
2002-11-21 14:34:12 +00:00
Michael Koch c3e0633cc3 2002-11-21 Michael Koch <konqueror@gmx.de>
* include/posix.h
       (_Jv_socket): New method.
       (_Jv_connect): New method.
       (_Jv_close): New method.
       (_Jv_platform_close_on_exec): Prefixed system function with "::".
       (_Jv_bind): New method.
       (_Jv_listen): New method.
       (_Jv_write): New method.
       (_Jv_read): New method.
       * include/win32.h
       (_Jv_socket): New method.
       (_Jv_connect): New method.
       (_Jv_close): New method.
       (_Jv_bind): New method.
       (_Jv_listen): New method.
       (_Jv_write): New method.
       (_Jv_read): New method.
       * java/net/natNetworkInterface.cc:
       Include platform.h, removed inclusion of socket.h
       (getRealNetworkInterfaces): Replaced ::socket() by _Jv_socket() and
       ::close() by _Jv_close().
       * java/net/natPlainDatagramSocketImpl.cc:
       Removed include of socket.h, definition of NATIVE_CLOSE and _Jv_bind,
       added some new lines to make code more readable.
       (create): Replaced ::socket() by _Jv_socket().
       (close): Replaced NATIVE_CLOSE() by _Jv_close().
       * java/net/natPlainSocketImpl.cc:
       Removed definition of NATIVE_CLOSE, _Jv_bind, Jv_connect and _Jv_accept,
       removed include of socket.h, removed some windows defines
       (now in include/win32.h).
       (create): Replaced ::socket() by _Jv_socket().
       (close): Replaced NATIVE_CLOSE() by _Jv_close().
       (write): Replaced ::read by _Jv_write().
       (read): Replaced ::read by _Jv_read().

From-SVN: r59338
2002-11-21 10:08:03 +00:00
Ranjit Mathew 93745862c4 jni.h: Add missing JNICALL and JNIEXPORT attributes to function and function pointer...
2002-11-19  Ranjit Mathew <rmathew@hotmail.com>

	* include/jni.h: Add missing JNICALL and JNIEXPORT attributes
	to function and function pointer declarations in accordance with
	Sun's JDKs. Define JNIIMPEXP to either JNIEXPORT or JNIIMPORT
	based on whether __GCJ_JNI_IMPL__ has been defined or not.
	* jni.cc: Add missing JNICALL and JNIEXPORT attributes to
	JNI function definitions.

From-SVN: r59277
2002-11-19 21:23:28 +00:00
Ranjit Mathew a2eb270a7e jni.h (JNIIMPORT, [...]): Linker defines for Win32.
2002-11-08  Ranjit Mathew <rmathew@hotmail.com>

	* include/jni.h (JNIIMPORT, JNIEXPORT, JNICALL): Linker defines
	for Win32. JNICALL has been defined to __stdcall to be compatible
	with Sun's JDKs.

From-SVN: r58985
2002-11-10 17:38:08 +00:00
Adam Megacz e2a450f6e8 aclocal.m4 (CHECK_FOR_BROKEN_MINGW_LD): added
2002-10-20  Adam Megacz <adam@xwt.org>

        * aclocal.m4 (CHECK_FOR_BROKEN_MINGW_LD): added
        * configure.in: enabled hash sync on Win32
        * include/win32-threads.h (_Jv_ThreadId_t): added.
        * java/lang/natObject.cc (_Jv_MonitorEnter, _Jv_MonitorExit,
        heavy_lock_obj_finalization_proc, wait, notify, notifyAll):
        removed some posix-isms, use Thread::sleep() instead of usleep,
        added code to clear bottom three bits if platform has a broken
        linker.  * include/win32-threads.h (_Jv_ThreadId_t): added.

From-SVN: r58344
2002-10-21 01:50:14 +00:00
Michael Koch 4d1d2b093d cvsignore: New file to ignore files generated during build.
2002-10-10  Michael Koch  <konqueror@gmx.de>

	* gcj/.cvsignore: New file to ignore files generated during build.
	* include/.cvsignore: New file to ignore files generated during build.

From-SVN: r58003
2002-10-10 05:21:53 +00:00