From: Georgi Gerganov Date: Tue, 18 Oct 2022 07:56:37 +0000 (+0300) Subject: ref #62 : fix build for some compilers X-Git-Tag: upstream/1.7.4~1946 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=d6b84b2a23220dd8b8792872a3ab6802cd24b424;p=pkg%2Fggml%2Fsources%2Fwhisper.cpp ref #62 : fix build for some compilers For some reason, new version of GCC panic when the struct type is not specified explicitly --- diff --git a/.gitignore b/.gitignore index b34c5126..f7e302c4 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,8 @@ stream .cache build/ build-em/ +build-debug/ +build-release/ out/ .vs/ .vscode/ diff --git a/whisper.cpp b/whisper.cpp index 8ef20cb8..61d0a8a2 100644 --- a/whisper.cpp +++ b/whisper.cpp @@ -2262,7 +2262,11 @@ struct whisper_full_params whisper_full_default_params(enum whisper_decode_strat switch (strategy) { case WHISPER_DECODE_GREEDY: { +#if defined(_MSC_VER) result = { +#else + result = (struct whisper_full_params) { +#endif .strategy = WHISPER_DECODE_GREEDY, .n_threads = std::min(4, (int32_t) std::thread::hardware_concurrency()), .offset_ms = 0, @@ -2283,8 +2287,12 @@ struct whisper_full_params whisper_full_default_params(enum whisper_decode_strat } break; case WHISPER_DECODE_BEAM_SEARCH: { +#if defined(_MSC_VER) result = { - .strategy = WHISPER_DECODE_GREEDY, +#else + result = (struct whisper_full_params) { +#endif + .strategy = WHISPER_DECODE_BEAM_SEARCH, .n_threads = std::min(4, (int32_t) std::thread::hardware_concurrency()), .offset_ms = 0,