summaryrefslogtreecommitdiff
path: root/meson.build
diff options
context:
space:
mode:
authorLuca Bacci <luca.bacci982@gmail.com>2023-10-05 09:21:08 +0200
committerLuca Bacci <luca.bacci982@gmail.com>2023-10-12 11:32:03 +0200
commit337912072ae97f753f5740a06b46a3c9a4840ab7 (patch)
tree944a1770d687f00e79621d759750e0c97f312602 /meson.build
parent9c81ff46a2071a8a35317e32f71763a65492a23e (diff)
Windows: Compile with the UNICODE / _UNICODE macros
It's the recommended way to build C/C++ projects on Windows, see https://learn.microsoft.com/en-us/windows/win32/intl/conventions-for-function-prototypes
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build4
1 files changed, 4 insertions, 0 deletions
diff --git a/meson.build b/meson.build
index fa6a9d8e1..6084471f8 100644
--- a/meson.build
+++ b/meson.build
@@ -213,6 +213,10 @@ if host_system == 'qnx'
add_project_arguments('-D_QNX_SOURCE', language: 'c')
endif
+if host_system == 'windows'
+ add_project_arguments(['-DUNICODE', '-D_UNICODE'], language: 'c')
+endif
+
# Disable strict aliasing;
# see https://bugzilla.gnome.org/show_bug.cgi?id=791622
if cc.has_argument('-fno-strict-aliasing')