X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fmisc.cpp;h=b651972bba18adff046b9668427059eff7dea925;hb=e9e7a7b83f78b5c7d29f69083589b449d9b52390;hp=be7abba5d017ddae5f5068008f0b914fe8a45942;hpb=5a88c5bb9b3e5ee431ac85abb8981b1571b68b2d;p=stockfish diff --git a/src/misc.cpp b/src/misc.cpp index be7abba5..b651972b 100644 --- a/src/misc.cpp +++ b/src/misc.cpp @@ -41,12 +41,13 @@ typedef WORD(*fun5_t)(); } #endif +#include #include #include #include #include +#include #include -#include #if defined(__linux__) && !defined(__ANDROID__) #include @@ -68,7 +69,7 @@ namespace Stockfish { namespace { /// Version number or dev. -const string version = "dev"; +constexpr string_view version = "dev"; /// Our fancy logging facility. The trick here is to replace cin.rdbuf() and /// cout.rdbuf() with two Tie objects that tie cin and cout to a file stream. We @@ -151,13 +152,13 @@ string engine_info(bool to_uci) { stringstream ss; ss << "Stockfish " << version << setfill('0'); - if (version == "dev") + if constexpr (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"); + constexpr string_view 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"