From 257a2b9646e845ef801588e871b9859d30ebf99a Mon Sep 17 00:00:00 2001 From: James Ross-Gowan Date: Mon, 23 Oct 2017 21:01:45 +1100 Subject: win32: add more-POSIXy versions of open() and fstat() Directory-opening never worked on Windows because MSVCRT's open() doesn't open directories and its fstat() doesn't recognise directory handles. These are just MSVCRT restrictions, and the Windows API itself has no problem with opening directories as file objects, so reimplement mpv's mp_open and mp_stat to use the Windows API directly. This should fix directory playback. This also populates the st_dev and st_ino fields of struct stat, so filesystem loop checking in demux_playlist.c should now work on Windows. Fixes #4711 --- waftools/detections/compiler.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'waftools/detections') diff --git a/waftools/detections/compiler.py b/waftools/detections/compiler.py index 7033cf561f..1befec5db5 100644 --- a/waftools/detections/compiler.py +++ b/waftools/detections/compiler.py @@ -52,7 +52,7 @@ def __add_clang_flags__(ctx): "-Wno-tautological-constant-out-of-range-compare" ] def __add_mswin_flags__(ctx): - ctx.env.CFLAGS += ['-D_WIN32_WINNT=0x0601', '-DUNICODE', '-DCOBJMACROS', + ctx.env.CFLAGS += ['-D_WIN32_WINNT=0x0602', '-DUNICODE', '-DCOBJMACROS', '-DINITGUID', '-U__STRICT_ANSI__'] ctx.env.LAST_LINKFLAGS += ['-Wl,--major-os-version=6,--minor-os-version=0', '-Wl,--major-subsystem-version=6,--minor-subsystem-version=0'] -- cgit v1.2.3