22 #define CLIENT_VERSION_SUFFIX "" 41 #ifdef HAVE_BUILD_INFO 48 #define GIT_COMMIT_ID "$Format:%h$" 49 #define GIT_COMMIT_DATE "$Format:%cD$" 52 #define BUILD_DESC_WITH_SUFFIX(maj, min, rev, build, suffix) \ 53 "v" DO_STRINGIZE(maj) "." DO_STRINGIZE(min) "." DO_STRINGIZE(rev) "." DO_STRINGIZE(build) "-" DO_STRINGIZE(suffix) 55 #define BUILD_DESC_FROM_COMMIT(maj, min, rev, build, commit) \ 56 "v" DO_STRINGIZE(maj) "." DO_STRINGIZE(min) "." DO_STRINGIZE(rev) "." DO_STRINGIZE(build) "-g" commit 58 #define BUILD_DESC_FROM_UNKNOWN(maj, min, rev, build) \ 59 "v" DO_STRINGIZE(maj) "." DO_STRINGIZE(min) "." DO_STRINGIZE(rev) "." DO_STRINGIZE(build) "-unk" 63 #define BUILD_DESC BUILD_DESC_WITH_SUFFIX(CLIENT_VERSION_MAJOR, CLIENT_VERSION_MINOR, CLIENT_VERSION_REVISION, CLIENT_VERSION_BUILD, BUILD_SUFFIX) 64 #elif defined(GIT_COMMIT_ID) 65 #define BUILD_DESC BUILD_DESC_FROM_COMMIT(CLIENT_VERSION_MAJOR, CLIENT_VERSION_MINOR, CLIENT_VERSION_REVISION, CLIENT_VERSION_BUILD, GIT_COMMIT_ID) 67 #define BUILD_DESC BUILD_DESC_FROM_UNKNOWN(CLIENT_VERSION_MAJOR, CLIENT_VERSION_MINOR, CLIENT_VERSION_REVISION, CLIENT_VERSION_BUILD) 73 static std::string FormatVersion(
int nVersion)
75 if (nVersion % 100 == 0)
76 return strprintf(
"%d.%d.%d", nVersion / 1000000, (nVersion / 10000) % 100, (nVersion / 100) % 100);
78 return strprintf(
"%d.%d.%d.%d", nVersion / 1000000, (nVersion / 10000) % 100, (nVersion / 100) % 100, nVersion % 100);
89 std::string
FormatSubVersion(
const std::string& name,
int nClientVersion,
const std::vector<std::string>& comments)
91 std::ostringstream ss;
93 ss << name <<
":" << FormatVersion(nClientVersion);
94 if (!comments.empty())
96 std::vector<std::string>::const_iterator it(comments.begin());
98 for(++it; it != comments.end(); ++it)
const std::string CLIENT_BUILD(BUILD_DESC CLIENT_VERSION_SUFFIX)
const std::string CLIENT_NAME("Ravencoin")
Name of client reported in the 'version' message.
#define CLIENT_VERSION_SUFFIX
Client version number.
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/raven/bips/blob/master/bip-0...