* libgcj.spec.in: Use THREADSTARTFILESPEC to affect the spec for
startfile.
* configure.ac: Allow targets to affect the spec for startfile
by specifying a THREADSTARTFILESPEC variable. Define this for
the win32 threads package to include crtmt.o.
* configure: Regenerate.
* win32.cc (_CRT_MT): Remove definition.
(__mingwthr_key_dtor): Likewise.
Co-Authored-By: Danny Smith <dannysmith@users.sourceforge.net>
From-SVN: r115196
* gcj/javaprims.h (_Jv_uintptr_t): New typedef similar to uintptr_t in
C99.
* include/java-stack.h: Include stdlib.h.
(_Jv_AddrInfo): New structure to hold address information.
* include/posix.h (_Jv_platform_dladdr): Declare.
* include/win32.h (_Jv_platform_dladdr): Declare.
(backtrace): Remove declaration.
* posix.cc: Include dlfcn.h if available. Include java-stack.h.
(_Jv_platform_dladdr): Define.
* win32.cc: Include string.h. Include java-stack.h.
(backtrace): Remove.
(_Jv_platform_dladdr): Define.
* sysdep/i386/backtrace.h (fallback_backtrace): Check that a potential
frame pointer value is 32-bit word-aligned. Use operand of the CALL
instruction calling the current function to find its starting address.
* stacktrace.cc: Do not include dlfcn.h. Include platform.h.
(_Jv_StackTrace::getLineNumberForFrame): Use _Jv_platform_dladdr()
instead of dladdr().
(_Jv_StackTrace::GetStackTraceElements): Use nCodeMap even for Windows.
(_Jv_StackTrace::GetClassContext): Use fallback_backtrace() for
targets with SJLJ exceptions instead of using _Unwind_Backtrace().
(_Jv_StackTrace::GetFirstNonSystemClassLoader): Likewise.
From-SVN: r115069
* configure.in: Added new MinGW-specific configure flag
--with-win32-nlsapi.
Added new AC_DEFINE MINGW_LIBGCJ_UNICODE.
Add -lunicows to MinGW SYSTEMSPEC if --with-win32-nlsapi
is set to unicows.
* configure: Rebuilt.
* include/config.h.in: Rebuilt.
* win32.cc (_Jv_Win32NewString): Implemented.
(nativeToUnicode): New helper function defined only for
non-UNICODE builds.
(unicodeToNative): Likewise.
(_Jv_Win32TempString): Implemented.
(lots): Refactored using tchar.h macros.
(WSAEventWrapper): Use _Jv_Win32NewString.
(_Jv_platform_initialize): Use GetModuleFileNameA instead
of GetModuleFileName.
(_Jv_platform_initProperties): Use _Jv_Win32NewString.
Use temporary stack buffer instead of a heap buffer.
* include/win32.h
Added defines for UNICODE and _UNICODE if MINGW_LIBGCJ_UNICODE is
defined; added tchar.h include.
(_Jv_Win32TempString): Declared new helper class.
(JV_TEMP_STRING_WIN32): New helper macro.
(_Jv_Win32NewString): Declared new helper method.
* java/io/natFileDescriptorWin32.cc (open): Use
JV_TEMP_STRING_WIN32 instead of JV_TEMP_UTF_STRING.
(write): Reformatted slightly.
* java/io/natFileWin32.cc (lots): Use tchar.h macros;
use JV_TEMP_STRING_WIN32 instead of JV_TEMP_UTF_STRING.
(getCanonicalPath): Use _Jv_Win32NewString instead of
JvNewStringUTF.
(performList): Likewise.
* java/lang/natWin32Process.cc (ChildProcessPipe):
Use tchar.h macros.
(startProcess): Use tchar.h macros, JV_TEMP_STRING_WIN32,
and UNICODE environment flag for CreateProcess.
* java/net/natNetworkInterfaceWin32.cc
(winsock2GetRealNetworkInterfaces): Use tchar.h macros and
_Jv_Win32NewString.
From-SVN: r74201
* include/win32.h (_Jv_platform_close_on_exec): Changed
signature and declared extern.
* win32.cc (_Jv_platform_close_on_exec): Implemented.
* gnu/java/net/natPlainDatagramSocketImplWin32.cc
(create): Use new signature of _Jv_platform_close_on_exec.
* gnu/java/net/natPlainSocketImplWin32.cc
(create): Eliminated a few typecasts
Use new signature of _Jv_platform_close_on_exec.
(accept): Eliminated a few typecasts
Use new signature of _Jv_platform_close_on_exec.
* java/io/natFileDescriptorWin32.cc (open): Use
_Jv_platform_close_on_exec.
From-SVN: r73325
* win32.cc: (dirExists) Internal helper function to
test for directory existence.
(getUserHome) New helper function refactored out
of _Jv_platform_initProperties. Uses USERPROFILE
instead of HOMEDIR and attempts to support Win9X and NT.
(_Jv_platform_initProperties) Use getUserHome.
From-SVN: r73117
* 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-07-26 Ranjit Mathew <rmathew@hotmail.com>
* win32.cc (_Jv_platform_initProperties): Use generic names
like "x86" for the "os.arch" property to be consistent with
what Sun's JDK produces. Use the wProcessorArchitecture
member of the Win32 SYSTEM_INFO structure, filled in a call
to GetSystemInfo( ), instead of dwProcessorType.
From-SVN: r69837
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
2002-04-11 Adam King <aking@dreammechanics.com>
Tom Tromey <tromey@redhat.com>
* include/jvm.h (_Jv_ThrowBadArrayIndex,
_Jv_ThrowNullPointerException): Mark as noreturn.
* win32.cc (_Jv_platform_initProperties): Use _Jv_MallocUnchecked
and _Jv_free. Correctly invoke GetTempPath(). Indentation
fixes.
Co-Authored-By: Tom Tromey <tromey@redhat.com>
From-SVN: r52164
2002-04-07 Adam King <aking@dreammechanics.com>
* java/lang/natSystem.cc (init_properties): Call new function
_Jv_platform_initProperties.
* win32 (_Jv_platform_initProperties): New function that adds Win32
support for the System properties os.name, os.arch, os.version,
user.name, user.home, and user.dir.
* include/posix.h, include/win32.h, posix.cc: New function
_Jv_platform_initProperties.
From-SVN: r51989
2002-02-06 Adam Megacz <adam@xwt.org>
* 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