summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-07-30 21:50:11 +0200
committerwm4 <wm4@nowhere>2015-07-30 21:50:11 +0200
commitfefac2c941149fb49bcb5126060be74494d0c287 (patch)
tree9835f45627a3c3bbb18f8e037ed0ff5ea24606a8 /video
parentc8fab7cc7b98af8da0bf734dbdb1a3efc5db977e (diff)
downloadmpv-fefac2c941149fb49bcb5126060be74494d0c287.tar.bz2
mpv-fefac2c941149fb49bcb5126060be74494d0c287.tar.xz
win32: more wchar_t -> WCHAR replacements
This was essentially missing from commit 0b52ac8a. Since L"..." string literals have the type wchar_t[], we can't use them for UTF-16 strings. Use C11 u"..." string literals instead. These have the type char16_t[], but we simply assume char16_t is the same underlying type as WCHAR. In practice, they're both unsigned short. For this reason use -std=c11 on Windows. Since Windows is a "special" environment (we require either MinGW or Cygwin), we don't need to worry too much about compiler compatibility.
Diffstat (limited to 'video')
-rw-r--r--video/decode/dxva2.c4
-rw-r--r--video/out/gl_w32.c4
-rw-r--r--video/out/w32_common.c4
3 files changed, 6 insertions, 6 deletions
diff --git a/video/decode/dxva2.c b/video/decode/dxva2.c
index c87093812c..d207aa504b 100644
--- a/video/decode/dxva2.c
+++ b/video/decode/dxva2.c
@@ -355,7 +355,7 @@ static int create_device(struct lavc_ctx *s)
}
}
- ctx->d3dlib = LoadLibrary(L"d3d9.dll");
+ ctx->d3dlib = LoadLibraryW(u"d3d9.dll");
if (!ctx->d3dlib) {
MP_ERR(ctx, "Failed to load D3D9 library\n");
goto fail;
@@ -423,7 +423,7 @@ static int dxva2_init(struct lavc_ctx *s)
ctx->deviceHandle = INVALID_HANDLE_VALUE;
- ctx->dxva2lib = LoadLibrary(L"dxva2.dll");
+ ctx->dxva2lib = LoadLibraryW(u"dxva2.dll");
if (!ctx->dxva2lib) {
MP_ERR(ctx, "Failed to load DXVA2 library\n");
goto fail;
diff --git a/video/out/gl_w32.c b/video/out/gl_w32.c
index 87f98f117e..68df3397c1 100644
--- a/video/out/gl_w32.c
+++ b/video/out/gl_w32.c
@@ -84,7 +84,7 @@ static void *w32gpa(const GLubyte *procName)
void *res = wglGetProcAddress(procName);
if (res)
return res;
- oglmod = GetModuleHandle(L"opengl32.dll");
+ oglmod = GetModuleHandleW(u"opengl32.dll");
return GetProcAddress(oglmod, procName);
}
@@ -208,7 +208,7 @@ static void create_ctx(void *ptr)
if (!w32_ctx->context)
create_context_w32_old(ctx);
- w32_ctx->dwmapi_dll = LoadLibrary(L"Dwmapi.dll");
+ w32_ctx->dwmapi_dll = LoadLibraryW(u"Dwmapi.dll");
if (w32_ctx->dwmapi_dll)
w32_ctx->dwmflush = (DwmFlush_t)GetProcAddress(w32_ctx->dwmapi_dll, "DwmFlush");
diff --git a/video/out/w32_common.c b/video/out/w32_common.c
index e9b01d5401..02e7064b59 100644
--- a/video/out/w32_common.c
+++ b/video/out/w32_common.c
@@ -42,7 +42,7 @@
#include "misc/rendezvous.h"
#include "talloc.h"
-static const WCHAR classname[] = L"mpv";
+static const WCHAR classname[] = u"mpv";
static __thread struct vo_w32_state *w32_thread_context;
@@ -1129,7 +1129,7 @@ static void *gui_thread(void *ptr)
.style = CS_HREDRAW | CS_VREDRAW,
.lpfnWndProc = WndProc,
.hInstance = hInstance,
- .hIcon = LoadIconW(hInstance, L"IDI_ICON1"),
+ .hIcon = LoadIconW(hInstance, u"IDI_ICON1"),
.hCursor = LoadCursor(NULL, IDC_ARROW),
.lpszClassName = classname,
};