summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve M. Robbins <smr@sumost.ca>2007-01-27 05:29:17 +0000
committerSteve M. Robbins <smr@sumost.ca>2007-01-27 05:29:17 +0000
commit50c65db468b6d10ad8fb42b50e7ea87367c21309 (patch)
tree3ebd21d50a7727ad57e7d9a035c99793f6724eb0
parent5542cdca278b1e7070b7c01c3efb086d965628af (diff)
Apply patch to fix [ 1293903 ] UNICODE Builds not supported
-rw-r--r--ChangeLog6
-rw-r--r--NEWS1
-rw-r--r--src/cppunit/Win32DynamicLibraryManager.cpp10
3 files changed, 12 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 90c0344..6977919 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2007-01-27 Steve M. Robbins <smr@sumost.ca>
+
+ * src/cppunit/Win32DynamicLibraryManager.cpp (doLoadLibrary):
+ Unconditionally use ANSI version of LoadLibrary() and other
+ functions with string arguments.
+
2007-01-26 Steve M. Robbins <smr@sumost.ca>
* config/ax_cxx_have_isfinite.m4: New. Autoconf macro that tests
diff --git a/NEWS b/NEWS
index 24d8cdd..9548315 100644
--- a/NEWS
+++ b/NEWS
@@ -9,6 +9,7 @@
* Portability:
- Fixed some compilation issue for QtTestRunner.
+ - Code should build on Windows in UNICODE mode.
New in CppUnit 1.12.0:
----------------------
diff --git a/src/cppunit/Win32DynamicLibraryManager.cpp b/src/cppunit/Win32DynamicLibraryManager.cpp
index 57cd1bd..acadf46 100644
--- a/src/cppunit/Win32DynamicLibraryManager.cpp
+++ b/src/cppunit/Win32DynamicLibraryManager.cpp
@@ -19,7 +19,7 @@ CPPUNIT_NS_BEGIN
DynamicLibraryManager::LibraryHandle
DynamicLibraryManager::doLoadLibrary( const std::string &libraryName )
{
- return ::LoadLibrary( libraryName.c_str() );
+ return ::LoadLibraryA( libraryName.c_str() );
}
@@ -43,22 +43,22 @@ std::string
DynamicLibraryManager::getLastErrorDetail() const
{
LPVOID lpMsgBuf;
- ::FormatMessage(
+ ::FormatMessageA(
FORMAT_MESSAGE_ALLOCATE_BUFFER |
FORMAT_MESSAGE_FROM_SYSTEM |
FORMAT_MESSAGE_IGNORE_INSERTS,
NULL,
GetLastError(),
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
- (LPTSTR) &lpMsgBuf,
+ (LPSTR) &lpMsgBuf,
0,
NULL
);
- std::string message = (LPCTSTR)lpMsgBuf;
+ std::string message = (LPCSTR)lpMsgBuf;
// Display the string.
-// ::MessageBox( NULL, (LPCTSTR)lpMsgBuf, "Error", MB_OK | MB_ICONINFORMATION );
+// ::MessageBoxA( NULL, (LPCSTR)lpMsgBuf, "Error", MB_OK | MB_ICONINFORMATION );
// Free the buffer.
::LocalFree( lpMsgBuf );