mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-22 01:56:58 +08:00
Fix ambiguity between clamp implementations
There is an ambiguity between global and std clamp implementations when compiling in c++17, and on certain toolchains that are not strictly conforming to c++11. This is solved by putting our clamp implementation in a namespace. closes https://github.com/official-stockfish/Stockfish/pull/2572 No functional change.
This commit is contained in:
committed by
Joost VandeVondele
parent
9690cd6295
commit
37e3863927
@@ -236,8 +236,8 @@ namespace {
|
||||
attackedBy2[Us] = dblAttackByPawn | (attackedBy[Us][KING] & attackedBy[Us][PAWN]);
|
||||
|
||||
// Init our king safety tables
|
||||
Square s = make_square(clamp(file_of(ksq), FILE_B, FILE_G),
|
||||
clamp(rank_of(ksq), RANK_2, RANK_7));
|
||||
Square s = make_square(Utility::clamp(file_of(ksq), FILE_B, FILE_G),
|
||||
Utility::clamp(rank_of(ksq), RANK_2, RANK_7));
|
||||
kingRing[Us] = PseudoAttacks[KING][s] | s;
|
||||
|
||||
kingAttackersCount[Them] = popcount(kingRing[Us] & pe->pawn_attacks(Them));
|
||||
|
||||
Reference in New Issue
Block a user