-
-
Notifications
You must be signed in to change notification settings - Fork 421
set WCHAR to wchar_t for future #2390
base: master
Are you sure you want to change the base?
Conversation
Thanks for your pull request, @WalterBright! Bugzilla referencesYour PR doesn't reference any Bugzilla issue. If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog. Testing this PR locallyIf you don't have a local development environment setup, you can use Digger to test this PR: dub fetch digger
dub run digger -- build "master + druntime#2390" |
What does C++11 compatibility have to do with the Windows API? The Windows API is all C and does not use type mangling. Is it for non-Windows C++ APIs which use Windows API types? |
Microsoft changed the definition of WCHAR to wchar_t. Meaning D cannot connect to C++ code that uses WCHAR. It'll get worse with increasing use of char16_t. |
They didn't 'change' the definition of |
Right, and for C it doesn't matter anyway because there is no mangling. |
And for MS code, it just so happens that |
Right, but there is a gotcha case, which MS have a hack to deal with; back in the old days, when programmers wrote C and It's all old deprecated junk though, we shouldn't bother ourselves with any of that history. |
Indeed, microsoft explicitly recommend against using that flag. |
* https://docs.microsoft.com/en-us/windows/desktop/extensiblestorageengine/gg269344(v%3Dexchg.10) | ||
* https://docs.microsoft.com/en-au/cpp/build/reference/zc-wchar-t-wchar-t-is-native-type?view=vs-2017 | ||
*/ | ||
version (Cpp98) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still have a moderate objection to this version name... cpp98
is not what's being expressed here. It's really just "old DMD behaviour".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
version (Cpp98) version (CppRuntimeDigitalMars)
would do the trick.
Part of transition to C++11 types. Blocked by dlang/dmd#9029