win32: replace wchar_t with WCHAR

WCHAR is more portable. While at least MinGW, Cygwin, and MSVC actually
use 16 bit wchar_t, Midipix will have 32 bit wchar_t. In that context,
using WCHAR instead is more portable.

This affects only non-MinGW parts, so not all uses of wchar_t need to
be changed. For example, terminal-win.c won't be used on Midipix at
all. (Most of io.c won't either, so the search & replace here is more
than necessary, but also not harmful.)

(Midipix is not useable yet, so this is just preparation.)
This commit is contained in:
wm4
2015-07-28 23:59:17 +02:00
parent 7d889fbdd0
commit 0b52ac8a78
7 changed files with 33 additions and 32 deletions

View File

@@ -174,7 +174,7 @@ static BOOL CALLBACK DirectSoundEnum(LPGUID guid, LPCSTR desc, LPCSTR module,
}
char *guidstr = talloc_strdup(NULL, "");
if (guid) {
wchar_t guidwstr[80] = {0};
WCHAR guidwstr[80] = {0};
StringFromGUID2(guid, guidwstr, MP_ARRAY_SIZE(guidwstr));
char *nstr = mp_to_utf8(NULL, guidwstr);
if (nstr) {

View File

@@ -25,6 +25,7 @@
#include <endpointvolume.h>
#include <mmdeviceapi.h>
#include <avrt.h>
#include <windows.h>
#include "audio/out/ao_wasapi.h"
#include "audio/out/ao_wasapi_utils.h"
@@ -344,9 +345,9 @@ static int control(struct ao *ao, enum aocontrol cmd, void *arg)
return CONTROL_TRUE;
case AOCONTROL_UPDATE_STREAM_TITLE: {
MP_VERBOSE(state, "Updating stream title to \"%s\"\n", (char*)arg);
wchar_t *title = mp_from_utf8(NULL, (char*)arg);
WCHAR *title = mp_from_utf8(NULL, (char*)arg);
wchar_t *tmp = NULL;
WCHAR *tmp = NULL;
/* There is a weird race condition in the IAudioSessionControl itself --
it seems that *sometimes* the SetDisplayName does not take effect and it still shows

View File

@@ -612,7 +612,7 @@ exit_label:
}
static HRESULT init_session_display(struct wasapi_state *state) {
wchar_t path[MAX_PATH+12] = {0};
WCHAR path[MAX_PATH+12] = {0};
HRESULT hr = IAudioClient_GetService(state->pAudioClient,
&IID_IAudioSessionControl,