summaryrefslogtreecommitdiffstats
path: root/waftools
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-01-07 21:33:14 +0100
committerwm4 <wm4@nowhere>2015-01-07 21:42:44 +0100
commitf61b8b312d251f9c8dd33d03d1566fd73019bf08 (patch)
treea75dbd7b94e403be08ec09c72fbd74178096d315 /waftools
parent5f398831d2aac9f65bc3499101f529fa51eebdf7 (diff)
downloadmpv-f61b8b312d251f9c8dd33d03d1566fd73019bf08.tar.bz2
mpv-f61b8b312d251f9c8dd33d03d1566fd73019bf08.tar.xz
win32: request UTF-16 API variants, Vista+ APIs, and COM C macros
Put the Vista+ (_WIN32_WINNT) and the COM C (COBJMACROS) defines into the build system, instead of defining them over and over in the code.
Diffstat (limited to 'waftools')
-rw-r--r--waftools/checks/custom.py2
-rw-r--r--waftools/detections/compiler.py5
-rw-r--r--waftools/fragments/wasapi.c2
3 files changed, 6 insertions, 3 deletions
diff --git a/waftools/checks/custom.py b/waftools/checks/custom.py
index 365c388800..fb45d8697c 100644
--- a/waftools/checks/custom.py
+++ b/waftools/checks/custom.py
@@ -24,7 +24,7 @@ def check_pthreads(ctx, dependency_identifier):
h = ctx.path.find_node('osdep/win32/include').abspath()
# define IN_WINPTHREAD to workaround mingw stupidity (we never want it
# to define features specific to its own pthread stuff)
- ctx.env.CFLAGS += ['-isystem', h, '-I', h, '-D_WIN32_WINNT=0x600', '-DIN_WINPTHREAD']
+ ctx.env.CFLAGS += ['-isystem', h, '-I', h, '-DIN_WINPTHREAD']
return True
if check_pthread_flag(ctx, dependency_identifier):
return True
diff --git a/waftools/detections/compiler.py b/waftools/detections/compiler.py
index 53b7d24892..a43a713de1 100644
--- a/waftools/detections/compiler.py
+++ b/waftools/detections/compiler.py
@@ -47,11 +47,16 @@ def __add_clang_flags__(ctx):
"-Wno-tautological-compare",
"-Wno-tautological-constant-out-of-range-compare" ]
+def __add_mswin_flags__(ctx):
+ ctx.env.CFLAGS += ['-D_WIN32_WINNT=0x600', '-DUNICODE', '-DCOBJMACROS']
+
def __add_mingw_flags__(ctx):
+ __add_mswin_flags__(ctx)
ctx.env.CFLAGS += ['-D__USE_MINGW_ANSI_STDIO=1']
ctx.env.LAST_LINKFLAGS += ['-mwindows']
def __add_cygwin_flags__(ctx):
+ __add_mswin_flags__(ctx)
ctx.env.CFLAGS += ['-mwin32']
ctx.env.CFLAGS += ['-U__STRICT_ANSI__']
diff --git a/waftools/fragments/wasapi.c b/waftools/fragments/wasapi.c
index ef3b3f7866..5528ce171b 100644
--- a/waftools/fragments/wasapi.c
+++ b/waftools/fragments/wasapi.c
@@ -1,5 +1,3 @@
-#define COBJMACROS 1
-#define _WIN32_WINNT 0x600
#include <malloc.h>
#include <stdlib.h>
#include <process.h>