mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-25 03:26:24 +08:00
A somewhat tricky function pointer cast allows us to move the platform specifics to lock.h, the cast is tricky because return type is not the same of the casted function in Linux (for Windows return type is a DWORD that is a long) but this should not be a problem as long as the size is the same; From: http://stackoverflow.com/questions/188839/function-pointer-cast-to-different-signature "OpenSSL was only casting functions pointers to other function types taking and returning the same number of values of the same exact sizes, and this (assuming you're not dealing with floating-point) happens to be safe across all the platforms and calling conventions I know of. However, anything else is potentially unsafe." No functional change. Signed-off-by: Marco Costalba <mcostalba@gmail.com>