Minor fixes for MSVC

closes https://github.com/official-stockfish/Stockfish/pull/6596

No functional change
This commit is contained in:
mstembera
2026-02-08 15:22:06 +01:00
committed by Disservin
parent bfeb36eb3d
commit 3cde1560f6
2 changed files with 5 additions and 1 deletions
+4
View File
@@ -457,6 +457,8 @@ void move_to_front(std::vector<T>& vec, Predicate pred) {
__builtin_unreachable(); \
} while (0)
#endif
#elif defined(_MSC_VER)
#define sf_assume(cond) __assume(cond)
#else
// do nothing for other compilers
#define sf_assume(cond)
@@ -464,6 +466,8 @@ void move_to_front(std::vector<T>& vec, Predicate pred) {
#ifdef __GNUC__
#define sf_unreachable() __builtin_unreachable()
#elif defined(_MSC_VER)
#define sf_unreachable() __assume(0)
#else
#define sf_unreachable()
#endif
+1 -1
View File
@@ -216,7 +216,7 @@ inline void read_leb_128(std::istream& stream, Arrays&... outs) {
auto bytes_left = read_little_endian<std::uint32_t>(stream);
std::array<std::uint8_t, 8192> buf;
std::uint32_t buf_pos = buf.size();
std::uint32_t buf_pos = std::uint32_t(buf.size());
(read_leb_128_detail(stream, outs, bytes_left, buf, buf_pos), ...);