From adb5c4c7dd3556eb6d5755d08d205ebe79f0c300 Mon Sep 17 00:00:00 2001 From: Barry Rowe Date: Thu, 16 Apr 2020 11:57:39 -0700 Subject: [PATCH] Moved SAPI code into a define. --- Makefile.common | 6 ++++++ frontend/drivers/platform_win32.c | 6 ++++++ qb/config.params.sh | 1 + 3 files changed, 13 insertions(+) diff --git a/Makefile.common b/Makefile.common index 9c6f7eebe4..bd3513dfda 100644 --- a/Makefile.common +++ b/Makefile.common @@ -23,6 +23,12 @@ ifeq ($(HAVE_NVDA), 1) LIBS += nvdaControllerClient64.dll endif +ifeq ($(HAVE_SAPI), 1) + LIBS += sapi.dll +endif + + + ifeq ($(HAVE_GL_CONTEXT),) HAVE_GL_CONTEXT = 0 HAVE_GL_MODERN = 0 diff --git a/frontend/drivers/platform_win32.c b/frontend/drivers/platform_win32.c index 2f1db1d605..5a9e019ef4 100644 --- a/frontend/drivers/platform_win32.c +++ b/frontend/drivers/platform_win32.c @@ -878,9 +878,11 @@ static bool create_win32_process(char* cmd) return true; } +#ifdef HAVE_SAPI #define COBJMACROS #include #include +#endif static ISpVoice* pVoice = NULL; #ifdef HAVE_NVDA @@ -928,6 +930,7 @@ static bool is_narrator_running_windows(void) */ } #endif +#ifdef HAVE_SAPI else { SPVOICESTATUS pStatus; @@ -940,6 +943,7 @@ static bool is_narrator_running_windows(void) return false; } } +#endif return false; } @@ -1012,6 +1016,7 @@ static bool accessibility_speak_windows(int speed, return true; } #endif +#ifdef HAVE_SAPI else { /* stop the old voice if running */ @@ -1038,6 +1043,7 @@ static bool accessibility_speak_windows(int speed, } return true; } +#endif } #endif diff --git a/qb/config.params.sh b/qb/config.params.sh index 2bf27734e5..f2ace2ee57 100644 --- a/qb/config.params.sh +++ b/qb/config.params.sh @@ -1,6 +1,7 @@ HAVE_LIBRETRO= # Libretro library used HAVE_ASSETS_DIR= # Assets install directory HAVE_NVDA=no # NVDA support +HAVE_SAPI=no # SAPI support HAVE_BLISSBOX=auto # Blissbox support HAVE_ANGLE=no # ANGLE support (OpenGL wrapper) HAVE_CONFIGFILE=yes # Config file support