Subject: [Boost-bugs] [Boost C++ Libraries] #996: boost threads doesn't build on windows with UNICODE
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2007-05-25 18:40:04
#996: boost threads doesn't build on windows with UNICODE
-----------------------------+----------------------------------------------
Reporter: arvid_at_[hidden] | Owner: anthonyw
Type: Bugs | Status: new
Milestone: | Component: thread
Version: | Severity: Problem
Keywords: |
-----------------------------+----------------------------------------------
in mutex.inl:
if (HMODULE kernel_module = GetModuleHandle(TEXT("KERNEL32.DLL")))
g_TryEnterCriticalSection =
reinterpret_cast<TryEnterCriticalSection_type>(GetProcAddress(kernel_module,
TEXT("TryEnterCriticalSection")));
The problem is that GetProcAddress() on windows only has ascii version
and takes lpcstr as the name of the function to lookup, so if you
define UNICODE to do windows unicode build, compiler complains that
you're trying to pass WCHAR* as char*.
A complication here is with wince, which is the opposite and only
takes WCHAR* as the name of the function so the correct code should
pass "TryEnterCriticalSection" on non-wince and
L"TryEnterCriticalSection" on wince.
--
Ticket URL: <http://svn.boost.org/trac/boost/ticket/996>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:49:55 UTC