Skip to content

Commit bac6255

Browse files
committed
Make UnicodeEnvironment also define _UNICODE.
Closes #149.
1 parent 933a713 commit bac6255

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

doc/configuration/properties.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ historical reasons.
101101
headers require it.
102102
* `UnicodeEnvironment` (`true`, `false`): Enable/disable compiling for a Unicode
103103
environment when targeting Windows in C/C++ projects. This causes the
104-
`UNICODE` macro to be defined, and makes it so that
104+
`UNICODE` and `_UNICODE` macros to be defined, and makes it so that
105105
[`wmain`](https://learn.microsoft.com/en-us/cpp/c-language/using-wmain) and
106106
[`wWinMain`](https://learn.microsoft.com/en-us/windows/win32/learnwin32/winmain--the-application-entry-point)
107107
entry point functions must be used when building executables. Defaults to

src/sdk/ZigCompile.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,10 @@ protected override string GenerateCommandLineCommands()
321321
builder.AppendSwitch("-fexceptions");
322322

323323
if (UnicodeEnvironment)
324+
{
324325
builder.AppendSwitch("-municode");
326+
builder.AppendSwitchIfNotNull("-D ", "_UNICODE");
327+
}
325328

326329
builder.AppendSwitch("-fno-strict-aliasing");
327330

0 commit comments

Comments
 (0)