Thread overview | ||||||
---|---|---|---|---|---|---|
|
December 02, 2018 Heads Up: Use WCHAR when interfacing with Windows | ||||
---|---|---|---|---|
| ||||
Due to name mangling changes required by compatibility with C++11, wchar_t will no longer mangle the same as wchar. Yes, I know, argghhh. What this means for Windows API calls is that the alias for WCHAR will change from wchar to wchar_t. To get a head start on this, when you're writing interface code to Windows, use WCHAR instead of wchar or wchar_t, and then your code will continue to compile before and after the change. Here's an example: https://github.com/dlang/druntime/pull/2392/files |
December 03, 2018 Re: Heads Up: Use WCHAR when interfacing with Windows | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | On Monday, 3 December 2018 at 03:30:41 UTC, Walter Bright wrote: > Due to name mangling changes required by compatibility with C++11, wchar_t will no longer mangle the same as wchar. Yes, I know, argghhh. What this means for Windows API calls is that the alias for WCHAR will change from wchar to wchar_t. > > To get a head start on this, when you're writing interface code to Windows, use WCHAR instead of wchar or wchar_t, and then your code will continue to compile before and after the change. > > Here's an example: > > https://github.com/dlang/druntime/pull/2392/files Could you please reply to my GitHub comments? I feel like all this is seriously underdocumented, and I don't understand why many of these changes are necessary. https://github.com/dlang/druntime/pull/2390#issuecomment-443552638 https://github.com/dlang/druntime/pull/2392#issuecomment-443579298 |
December 03, 2018 Re: Heads Up: Use WCHAR when interfacing with Windows | ||||
---|---|---|---|---|
| ||||
Posted in reply to Vladimir Panteleev | On Monday, 3 December 2018 at 03:39:29 UTC, Vladimir Panteleev wrote:
> I feel like all this is seriously underdocumented, and I don't understand why many of these changes are necessary.
I agree, this makes zero sense to me. Windows functions are mangled Name@size - the specific types are irrelevant.
|
December 02, 2018 Re: Heads Up: Use WCHAR when interfacing with Windows | ||||
---|---|---|---|---|
| ||||
Posted in reply to Vladimir Panteleev | On 12/2/2018 7:39 PM, Vladimir Panteleev wrote:
> Could you please reply to my GitHub comments?
Done.
|
Copyright © 1999-2021 by the D Language Foundation