1
0
mirror of https://github.com/libretro/RetroArch synced 2025-04-01 13:20:43 +00:00

Buildfix MSVC 2010

This commit is contained in:
twinaphex 2020-04-17 16:40:39 +02:00
parent 352519c91e
commit b91c342ff4

@ -884,20 +884,22 @@ static bool create_win32_process(char* cmd)
#include <ole2.h> #include <ole2.h>
#endif #endif
#ifdef HAVE_SAPI
static ISpVoice* pVoice = NULL; static ISpVoice* pVoice = NULL;
#ifdef HAVE_NVDA
bool USE_POWERSHELL = false;
bool USE_NVDA = true;
#else
bool USE_POWERSHELL = true;
bool USE_NVDA = false;
#endif #endif
bool USE_NVDA_BRAILLE = false; #ifdef HAVE_NVDA
bool USE_POWERSHELL = false;
bool USE_NVDA = true;
#else
bool USE_POWERSHELL = true;
bool USE_NVDA = false;
#endif
bool USE_NVDA_BRAILLE = false;
static bool is_narrator_running_windows(void) static bool is_narrator_running_windows(void)
{ {
DWORD status = 0; DWORD status = 0;
bool res;
if (USE_POWERSHELL) if (USE_POWERSHELL)
{ {
if (pi_set == false) if (pi_set == false)
@ -912,35 +914,30 @@ static bool is_narrator_running_windows(void)
#ifdef HAVE_NVDA #ifdef HAVE_NVDA
else if (USE_NVDA) else if (USE_NVDA)
{ {
long res=nvdaController_testIfRunning(); long res = nvdaController_testIfRunning();
if(res!=0)
if (res != 0)
{ {
/* The running nvda service wasn't found, so revert /* The running nvda service wasn't found, so revert
back to the powershell method back to the powershell method
*/ */
RARCH_LOG("Error communicating with NVDA\n"); RARCH_LOG("Error communicating with NVDA\n");
USE_POWERSHELL = true; USE_POWERSHELL = true;
USE_NVDA = false; USE_NVDA = false;
return false; return false;
} }
return false; return false;
/*
nvdaController_speakText(L"This is a test speech message");
nvdaController_brailleMessage(L"This is a test braille message");
*/
} }
#endif #endif
#ifdef HAVE_SAPI #ifdef HAVE_SAPI
else else
{ {
SPVOICESTATUS pStatus; SPVOICESTATUS pStatus;
if (pVoice != NULL) if (pVoice)
{ {
ISpVoice_GetStatus(pVoice, &pStatus, NULL); ISpVoice_GetStatus(pVoice, &pStatus, NULL);
if (pStatus.dwRunningState == SPRS_IS_SPEAKING) if (pStatus.dwRunningState == SPRS_IS_SPEAKING)
return true; return true;
else
return false;
} }
} }
#endif #endif
@ -992,12 +989,13 @@ static bool accessibility_speak_windows(int speed,
#ifdef HAVE_NVDA #ifdef HAVE_NVDA
else if (USE_NVDA) else if (USE_NVDA)
{ {
long res=nvdaController_testIfRunning(); long res = nvdaController_testIfRunning();
const size_t cSize = strlen(speak_text)+1; const size_t cSize = strlen(speak_text) + 1;
wchar_t* wc = malloc(sizeof(wchar_t)*cSize); wchar_t *wc = malloc(sizeof(wchar_t) * cSize);
mbstowcs(wc, speak_text, cSize); mbstowcs(wc, speak_text, cSize);
if(res!=0) if (res != 0)
{ {
RARCH_LOG("Error communicating with NVDA\n"); RARCH_LOG("Error communicating with NVDA\n");
return false; return false;
@ -1020,7 +1018,7 @@ static bool accessibility_speak_windows(int speed,
else else
{ {
/* stop the old voice if running */ /* stop the old voice if running */
if (pVoice != NULL) if (pVoice)
{ {
CoUninitialize(); CoUninitialize();
ISpVoice_Release(pVoice); ISpVoice_Release(pVoice);
@ -1031,7 +1029,9 @@ static bool accessibility_speak_windows(int speed,
if (FAILED(CoInitialize(NULL))) if (FAILED(CoInitialize(NULL)))
return NULL; return NULL;
hr = CoCreateInstance(&CLSID_SpVoice, NULL, CLSCTX_ALL, &IID_ISpVoice, (void **)&pVoice); hr = CoCreateInstance(&CLSID_SpVoice, NULL,
CLSCTX_ALL, &IID_ISpVoice, (void **)&pVoice);
if (SUCCEEDED(hr)) if (SUCCEEDED(hr))
{ {
wchar_t wtext[1200]; wchar_t wtext[1200];