From 83d7b40bc88f78fd38cb5a30c789671169fe3741 Mon Sep 17 00:00:00 2001 From: membar Date: Tue, 2 Dec 2003 22:26:50 +0000 Subject: * 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@74201 138bc75d-0d04-0410-961f-82ee72b054a4 --- libjava/java/net/natNetworkInterfaceWin32.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'libjava/java/net') diff --git a/libjava/java/net/natNetworkInterfaceWin32.cc b/libjava/java/net/natNetworkInterfaceWin32.cc index 20c9a9b5967..d4c2b173f89 100644 --- a/libjava/java/net/natNetworkInterfaceWin32.cc +++ b/libjava/java/net/natNetworkInterfaceWin32.cc @@ -70,18 +70,18 @@ winsock2GetRealNetworkInterfaces (jstring* pjstrName, // have access to the real name under Winsock 2, we use // "lo" for the loopback interface and ethX for the // real ones. - char szName[30]; + TCHAR szName[30]; u_long lFlags = arInterfaceInfo[i].iiFlags; if (lFlags & IFF_LOOPBACK) - strcpy (szName, "lo"); + _tcscpy (szName, _T("lo")); else { - strcpy (szName, "eth"); - wsprintf(szName+3, "%d", nCurETHInterface++); + _tcscpy (szName, _T("eth")); + wsprintf(szName+3, _T("%d"), nCurETHInterface++); } - jstring if_name = JvNewStringLatin1 (szName); + jstring if_name = _Jv_Win32NewString (szName); java::net::Inet4Address* address = new java::net::Inet4Address (baddr, JvNewStringLatin1 ("")); pjstrName[i] = if_name; -- cgit v1.2.3