Opened 15 years ago
Closed 15 years ago
#996 closed Bugs (fixed)
boost threads doesn't build on windows with UNICODE
Reported by: | Owned by: | Anthony Williams | |
---|---|---|---|
Milestone: | Boost 1.34.1 | Component: | thread |
Version: | Boost 1.34.0 | Severity: | Showstopper |
Keywords: | Cc: | kkowalczyk@…, witt@… |
Description
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.
Attachments (1)
Change History (4)
comment:1 by , 15 years ago
Cc: | added |
---|---|
Milestone: | → Boost 1.34.1 |
Severity: | Problem → Showstopper |
Version: | → release 1.34.0 |
comment:2 by , 15 years ago
Status: | new → assigned |
---|
by , 15 years ago
Attachment: | mutex.inl.patch added |
---|
comment:3 by , 15 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Patch applied.