mirror of
https://github.com/official-stockfish/Stockfish.git
synced 2026-07-22 20:57:10 +00:00
Minor fixes for MSVC
closes https://github.com/official-stockfish/Stockfish/pull/6596 No functional change
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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), ...);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user