diff options
author | sluicebox | 2019-10-09 12:19:31 -0700 |
---|---|---|
committer | Filippos Karapetis | 2019-10-10 22:55:12 +0300 |
commit | 912bbf364c1c287f891291229d30226a5a71eed9 (patch) | |
tree | 19aab23318a982ff80636685f5d920d25b80ffdc | |
parent | c1697cd177eee47dc413273ff9f50b93cfcd5f9f (diff) | |
download | scummvm-rg350-912bbf364c1c287f891291229d30226a5a71eed9.tar.gz scummvm-rg350-912bbf364c1c287f891291229d30226a5a71eed9.tar.bz2 scummvm-rg350-912bbf364c1c287f891291229d30226a5a71eed9.zip |
TTS: Enable in Mingw-w64 builds
TTS libraries can now be used in default Mingw-w64 environments.
- Removes reference to sapiddk.h which isn't used and isn't in Mingw-w64
- Defines guids whose symbols are missing from Mingw-w64
- Restores TTS detection to configure script
-rw-r--r-- | backends/text-to-speech/windows/sphelper-scummvm.h | 5 | ||||
-rw-r--r-- | backends/text-to-speech/windows/windows-text-to-speech.cpp | 11 | ||||
-rwxr-xr-x | configure | 9 |
3 files changed, 21 insertions, 4 deletions
diff --git a/backends/text-to-speech/windows/sphelper-scummvm.h b/backends/text-to-speech/windows/sphelper-scummvm.h index 9ced239a34..93b2bb52f1 100644 --- a/backends/text-to-speech/windows/sphelper-scummvm.h +++ b/backends/text-to-speech/windows/sphelper-scummvm.h @@ -15,6 +15,7 @@ // crtdbg.h // SPDebug.h // atlbase.h +// sapiddk.h // // 3. Include got added // cwtype @@ -45,10 +46,6 @@ #include <sapi.h> #endif -#ifndef __sapiddk_h__ -#include <sapiddk.h> -#endif - #ifndef SPError_h #include <SPError.h> #endif diff --git a/backends/text-to-speech/windows/windows-text-to-speech.cpp b/backends/text-to-speech/windows/windows-text-to-speech.cpp index 9e6d30cd3a..3399e45826 100644 --- a/backends/text-to-speech/windows/windows-text-to-speech.cpp +++ b/backends/text-to-speech/windows/windows-text-to-speech.cpp @@ -29,6 +29,17 @@ #include <basetyps.h> #include <windows.h> #include <Servprov.h> + +// Mingw-w64 is missing symbols for two guids declared in sapi.h which are used +// by sphelper-scummvm.h. Mingw32 doesn't include any sapi headers or libraries +// so the only way to currently build there is to manually use Microsoft's, in +// which case the guids will be defined by their library. +#if defined(__MINGW32__) && defined(__MINGW64_VERSION_MAJOR) +#include <initguid.h> +DEFINE_GUID(SPDFID_Text, 0x7ceef9f9, 0x3d13, 0x11d2, 0x9e, 0xe7, 0x00, 0xc0, 0x4f, 0x79, 0x73, 0x96); +DEFINE_GUID(SPDFID_WaveFormatEx, 0xc31adbae, 0x527f, 0x4ff5, 0xa2, 0x30, 0xf6, 0x2b, 0xb6, 0x1f, 0xf7, 0x0c); +#endif + #include <sapi.h> #include "backends/text-to-speech/windows/sphelper-scummvm.h" #include "backends/platform/sdl/win32/win32_wrapper.h" @@ -4239,6 +4239,15 @@ echocheck "TTS libraries" if test "$_tts" = auto ; then _tts=no case $_host_os in + mingw*) + cat > $TMPC << EOF +#include <windows.h> +#include <Servprov.h> +#include <sapi.h> +int main(void) { return 0; } +EOF + cc_check -lsapi -lole32 && _tts=yes + ;; linux*) cat > $TMPC << EOF #include <speech-dispatcher/libspeechd.h> |