-
-
Notifications
You must be signed in to change notification settings - Fork 613
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f35640a
commit e2a2ae1
Showing
5 changed files
with
73 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
Transition to C++11 character types | ||
|
||
With C++11 comes the advent of changed character type mangling. | ||
D's default behavior is now to conform to this. However, this | ||
will break existing code. Therefore, the old behavior can be | ||
retained by using the -version=Cpp98 compiler switch. | ||
For Win32 compilations using Digital Mars C++, -version=Cpp98 will | ||
be predefined. | ||
|
||
Of particular note is the new difference between wchar and wchar_t on | ||
Windows. This will manifest itself as compile errors when | ||
interfacing wchar* with wchar_t* code when calling the Windows API. | ||
A cast will resolve the issue. | ||
|
||
Going forward we recommend using WCHAR instead of wchar or wchar_t | ||
when interfacing to Windows API functions. (WCHAR is Microsoft | ||
Windows' 16 bit character type.) | ||
|
||
C++ Type Equivalence | ||
|
||
Cpp98 behavior: | ||
|
||
D Posix DMC++ Windows VC++ Windows | ||
---------------------------------------------------- | ||
wchar unsigned short wchar_t wchar_t | ||
dchar wchar_t unsigned unsigned | ||
wchar_t wchar_t wchar_t wchar_t | ||
WCHAR -- wchar_t wchar_t | ||
|
||
New behavior: | ||
|
||
D Posix DMC++ Windows VC++ Windows | ||
---------------------------------------------------- | ||
wchar char16_t wchar_t char16_t | ||
dchar char32_t unsigned char32_t | ||
wchar_t wchar_t wchar wchar_t | ||
WCHAR -- wchar wchar_t | ||
|
||
|
||
Name Mangling: | ||
|
||
Cpp98 behavior: | ||
|
||
D Posix DMC++ Windows VC++ Windows | ||
-------------------------------------------- | ||
wchar t _Y _W | ||
dchar w I I | ||
wchar_t w _Y _W | ||
|
||
New behavior: | ||
|
||
Posix DMC++ Windows VC++ Windows | ||
wchar Ds _Y _S | ||
dchar Di I _U | ||
wchar_t w _Y _W | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters