Skip to content

Commit d6b84b2

Browse files
committed
ref #62 : fix build for some compilers
For some reason, new version of GCC panic when the struct type is not specified explicitly
1 parent b4a3875 commit d6b84b2

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ stream
55
.cache
66
build/
77
build-em/
8+
build-debug/
9+
build-release/
810
out/
911
.vs/
1012
.vscode/

whisper.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2262,7 +2262,11 @@ struct whisper_full_params whisper_full_default_params(enum whisper_decode_strat
22622262
switch (strategy) {
22632263
case WHISPER_DECODE_GREEDY:
22642264
{
2265+
#if defined(_MSC_VER)
22652266
result = {
2267+
#else
2268+
result = (struct whisper_full_params) {
2269+
#endif
22662270
.strategy = WHISPER_DECODE_GREEDY,
22672271
.n_threads = std::min(4, (int32_t) std::thread::hardware_concurrency()),
22682272
.offset_ms = 0,
@@ -2283,8 +2287,12 @@ struct whisper_full_params whisper_full_default_params(enum whisper_decode_strat
22832287
} break;
22842288
case WHISPER_DECODE_BEAM_SEARCH:
22852289
{
2290+
#if defined(_MSC_VER)
22862291
result = {
2287-
.strategy = WHISPER_DECODE_GREEDY,
2292+
#else
2293+
result = (struct whisper_full_params) {
2294+
#endif
2295+
.strategy = WHISPER_DECODE_BEAM_SEARCH,
22882296
.n_threads = std::min(4, (int32_t) std::thread::hardware_concurrency()),
22892297
.offset_ms = 0,
22902298

0 commit comments

Comments
 (0)