Commit 0411662
committed
fixup: MSVC
Windows MSVC build of upstream PR #4949 failed with
`LNK2019: unresolved external symbol __builtin_expect` because
`__builtin_expect` is a GCC/Clang builtin and MSVC has nothing
equivalent. The branch-predictor hints are an optimization, not
correctness, so the simplest portable fix is a no-op fallback
gated on `!defined(__GNUC__) && !defined(__clang__)`.
Lives at the top of `wasm_interp_fast.c` rather than in
`bh_platform.h` to avoid touching the shared header for a
local cold-path concern.__builtin_expect shim for the cold-path hints1 parent 231862a commit 0411662
1 file changed
Lines changed: 9 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
28 | 37 | | |
29 | 38 | | |
30 | 39 | | |
| |||
0 commit comments