From: Steinar H. Gunderson Date: Mon, 26 Dec 2022 08:41:43 +0000 (+0100) Subject: Merge remote-tracking branch 'upstream/master' X-Git-Url: https://git.sesse.net/?p=stockfish;a=commitdiff_plain;h=e533b620caf72b05969dd756355cbaeb6ae5f7a6 Merge remote-tracking branch 'upstream/master' --- e533b620caf72b05969dd756355cbaeb6ae5f7a6 diff --cc src/Makefile index 23c19bfb,500c1006..171f966c --- a/src/Makefile +++ b/src/Makefile @@@ -365,9 -366,9 +369,9 @@@ endi ifeq ($(COMP),gcc) comp=gcc CXX=g++ - CXXFLAGS += -pedantic -Wextra -Wshadow + CXXFLAGS += -pedantic -Wextra - ifeq ($(arch),$(filter $(arch),armv7 armv8)) + ifeq ($(arch),$(filter $(arch),armv7 armv8 riscv64)) ifeq ($(OS),Android) CXXFLAGS += -m$(bits) LDFLAGS += -m$(bits) diff --cc src/misc.cpp index 9cfd6304,c7fa0e9a..3c336c30 --- a/src/misc.cpp +++ b/src/misc.cpp @@@ -138,24 -137,41 +137,35 @@@ public } // namespace - /// engine_info() returns the full name of the current Stockfish version. This - /// will be either "Stockfish DD-MM-YY" (where DD-MM-YY is the date when - /// the program was compiled) or "Stockfish ", depending on whether - /// Version is empty. + /// engine_info() returns the full name of the current Stockfish version. + /// For local dev compiles we try to append the commit sha and commit date + /// from git if that fails only the local compilation date is set and "nogit" is specified: + /// Stockfish dev-YYYYMMDD-SHA + /// or + /// Stockfish dev-YYYYMMDD-nogit + /// + /// For releases (non dev builds) we only include the version number: + /// Stockfish version string engine_info(bool to_uci) { + stringstream ss; + ss << "Stockfish " << version << setfill('0'); - const string months("Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec"); - string month, day, year; - stringstream ss, date(__DATE__); // From compiler, format is "Sep 21 2008" - - ss << "Stockfish " << Version << setfill('0'); - - if (Version.empty()) + if (version == "dev") { + ss << "-"; + #ifdef GIT_DATE + ss << GIT_DATE; + #else + const string months("Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec"); + string month, day, year; + stringstream date(__DATE__); // From compiler, format is "Sep 21 2008" + date >> month >> day >> year; - ss << setw(2) << day << setw(2) << (1 + months.find(month) / 4) << year.substr(2); + ss << year << setw(2) << setfill('0') << (1 + months.find(month) / 4) << setw(2) << setfill('0') << day; + #endif + - ss << "-"; - - #ifdef GIT_SHA - ss << GIT_SHA; - #else - ss << "nogit"; - #endif + ss << "-asn"; } ss << (to_uci ? "\nid author ": " by ")