21 #define CLIENT_VERSION_SUFFIX "" 40 #ifdef HAVE_BUILD_INFO 47 #define GIT_COMMIT_ID "$Format:%h$" 48 #define GIT_COMMIT_DATE "$Format:%cD$" 51 #define BUILD_DESC_WITH_SUFFIX(maj, min, rev, build, suffix) \ 52 "v" DO_STRINGIZE(maj) "." DO_STRINGIZE(min) "." DO_STRINGIZE(rev) "." DO_STRINGIZE(build) "-" DO_STRINGIZE(suffix) 54 #define BUILD_DESC_FROM_COMMIT(maj, min, rev, build, commit) \ 55 "v" DO_STRINGIZE(maj) "." DO_STRINGIZE(min) "." DO_STRINGIZE(rev) "." DO_STRINGIZE(build) "-g" commit 57 #define BUILD_DESC_FROM_UNKNOWN(maj, min, rev, build) \ 58 "v" DO_STRINGIZE(maj) "." DO_STRINGIZE(min) "." DO_STRINGIZE(rev) "." DO_STRINGIZE(build) "-unk" 62 #define BUILD_DESC BUILD_DESC_WITH_SUFFIX(CLIENT_VERSION_MAJOR, CLIENT_VERSION_MINOR, CLIENT_VERSION_REVISION, CLIENT_VERSION_BUILD, BUILD_SUFFIX) 63 #elif defined(GIT_COMMIT_ID) 64 #define BUILD_DESC BUILD_DESC_FROM_COMMIT(CLIENT_VERSION_MAJOR, CLIENT_VERSION_MINOR, CLIENT_VERSION_REVISION, CLIENT_VERSION_BUILD, GIT_COMMIT_ID) 66 #define BUILD_DESC BUILD_DESC_FROM_UNKNOWN(CLIENT_VERSION_MAJOR, CLIENT_VERSION_MINOR, CLIENT_VERSION_REVISION, CLIENT_VERSION_BUILD) 72 static std::string FormatVersion(
int nVersion)
74 if (nVersion % 100 == 0)
75 return strprintf(
"%d.%d.%d", nVersion / 1000000, (nVersion / 10000) % 100, (nVersion / 100) % 100);
77 return strprintf(
"%d.%d.%d.%d", nVersion / 1000000, (nVersion / 10000) % 100, (nVersion / 100) % 100, nVersion % 100);
88 std::string
FormatSubVersion(
const std::string&
name,
int nClientVersion,
const std::vector<std::string>& comments)
90 std::ostringstream ss;
92 ss << name <<
":" << FormatVersion(nClientVersion);
93 if (!comments.empty())
95 std::vector<std::string>::const_iterator it(comments.begin());
97 for(++it; it != comments.end(); ++it)
const std::string CLIENT_BUILD(BUILD_DESC CLIENT_VERSION_SUFFIX)
#define CLIENT_VERSION_SUFFIX
Client version number.
const std::string CLIENT_NAME("Satoshi")
Name of client reported in the 'version' message.
std::string FormatFullVersion()
std::string FormatSubVersion(const std::string &name, int nClientVersion, const std::vector< std::string > &comments)
Format the subversion field according to BIP 14 spec (https://github.com/fabcoin/bips/blob/master/bip...