]> git.sesse.net Git - stockfish/commit - src/syzygy/tbprobe.cpp
Improve compatibility
authorMaxim Masiutin <maxim@masiutin.com>
Sun, 12 Mar 2023 13:16:51 +0000 (15:16 +0200)
committerJoost VandeVondele <Joost.VandeVondele@gmail.com>
Sat, 1 Apr 2023 13:36:08 +0000 (15:36 +0200)
commit7a6fa34f5f9f0f193d9350cd58c82a8f98a6505d
tree1afafd02c32f60e56e2c797f31acdcac9377e44b
parent3f01e3f41f11aa66befec2307a32ee023c699a2a
Improve compatibility

this makes it easier to compile under MSVC, even though we recommend gcc/clang for production compiles at the moment.

In Win32 API, by default, most null-terminated character strings arguments are of wchar_t (UTF16, formerly UCS16-LE) type, i.e. 2 bytes (at least) per character. So, src/misc.cpp should have proper type. Respectively, for src/syzygy/tbprobe.cpp, in Widows, file paths should be std::wstring rather than std::string. However, this requires a very big number of changes, since the config files are also keeping the 8-bit-per-character std::string strings. Therefore, just one change of using 8-byte-per-character CreateFileA make it compile under MSVC.

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

No functional change
src/misc.cpp
src/syzygy/tbprobe.cpp