]> git.sesse.net Git - stockfish/commit
Fix a compile error in opposite_colors()
authorMarco Costalba <mcostalba@gmail.com>
Sat, 2 Jun 2012 07:51:58 +0000 (08:51 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Sat, 2 Jun 2012 08:04:11 +0000 (09:04 +0100)
commit764d3f44b68c01eeb9e7759e75aebe18488322c1
tree49d799b5e0bcb53ba4f874cf2aaf8de8a0a2f9b1
parent0412f4a1ee1b738441490dd6f3d324c21ee75987
Fix a compile error in opposite_colors()

Error is due to ambiguous overloading of operator^
because we have both the built-in operator^(int, int)
and the user defined operator^(Bitboard, Square).

This error does not trigger when using Makefile becuase,
due to luck, the user defined operator^(Bitboard, Square)
happens to be always defined _after_ opposite_colors() so
that compiler does not claim. But in case of Microsoft MSVC
we don't have a Makefile and the order of files compilation
is chosen by the compiler (in an unpredictable way). So it
could still happen that error is not detected (as in my case),
but in another case the order of compilation of the files could
be so that at some point both operator^ were defined before
opposite_colors() and this triggers the error.

The fix is much simpler than the explanation :-)

Reported by Quocvuong82.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
src/types.h