Skip to content

Commit

Permalink
Merge pull request #3381 from AndrejMitrovic/Fix11735
Browse files Browse the repository at this point in the history
Fixes Issue 11735 - pragma(msg) doesn't work with wchar/dchar strings.
  • Loading branch information
yebblies committed Mar 15, 2014
2 parents c015f0d + c70e229 commit dea20e7
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/statement.c
Original file line number Diff line number Diff line change
Expand Up @@ -2652,6 +2652,7 @@ Statement *PragmaStatement::semantic(Scope *sc)
StringExp *se = e->toStringExp();
if (se)
{
se = se->toUTF8(sc);
fprintf(stderr, "%.*s", (int)se->len, (char *)se->string);
}
else
Expand Down
14 changes: 14 additions & 0 deletions test/compilable/bug11735.d
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ print dstring
يطبع الترميز الموحد
يطبع الترميز الموحد
يطبع الترميز الموحد
foo_str
foo_wstr
foo_dstr
---
*/

Expand All @@ -20,3 +23,14 @@ pragma(msg, "print dstring"d);
pragma(msg, "يطبع الترميز الموحد");
pragma(msg, "يطبع الترميز الموحد"w);
pragma(msg, "يطبع الترميز الموحد"d);

void main()
{
enum a = "foo_str";
enum b = "foo_wstr"w;
enum c = "foo_dstr"d;

pragma(msg, a);
pragma(msg, b);
pragma(msg, c);
}

0 comments on commit dea20e7

Please sign in to comment.