Bitcoin ABC  0.24.7
P2P Digital Currency
clientversion.h
Go to the documentation of this file.
1 // Copyright (c) 2009-2016 The Bitcoin Core developers
2 // Copyright (c) 2017-2019 The Bitcoin developers
3 // Distributed under the MIT software license, see the accompanying
4 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
5 
6 #ifndef BITCOIN_CLIENTVERSION_H
7 #define BITCOIN_CLIENTVERSION_H
8 
9 #if defined(HAVE_CONFIG_H)
10 #include <config/bitcoin-config.h>
11 #endif // HAVE_CONFIG_H
12 #include <config/version.h>
13 
14 // Check that required client information is defined
15 #if !defined(CLIENT_VERSION_MAJOR) || !defined(CLIENT_VERSION_MINOR) || \
16  !defined(CLIENT_VERSION_REVISION) || !defined(COPYRIGHT_YEAR) || \
17  !defined(CLIENT_VERSION_IS_RELEASE)
18 #error Client version information missing: version is not defined by bitcoin-config.h nor defined any other way
19 #endif
20 
26 #define STRINGIZE(X) DO_STRINGIZE(X)
27 #define DO_STRINGIZE(X) #X
28 
30 #define COPYRIGHT_STR \
31  "2009-" STRINGIZE(COPYRIGHT_YEAR) " " COPYRIGHT_HOLDERS_FINAL
32 
39 #if !defined(WINDRES_PREPROC)
40 
41 #include <string>
42 #include <vector>
43 
44 static constexpr int CLIENT_VERSION = 1000000 * CLIENT_VERSION_MAJOR +
45  10000 * CLIENT_VERSION_MINOR +
46  100 * CLIENT_VERSION_REVISION;
47 
48 extern const std::string CLIENT_NAME;
49 extern const std::string CLIENT_BUILD;
50 
51 std::string FormatVersion(int nVersion);
52 std::string FormatFullVersion();
53 std::string FormatUserAgent(const std::string &name, const std::string &version,
54  const std::vector<std::string> &comments);
55 
56 #endif // WINDRES_PREPROC
57 
58 #endif // BITCOIN_CLIENTVERSION_H
CLIENT_BUILD
const std::string CLIENT_BUILD
FormatFullVersion
std::string FormatFullVersion()
Definition: clientversion.cpp:58
CLIENT_NAME
const std::string CLIENT_NAME
name
const char * name
Definition: rest.cpp:43
CLIENT_VERSION
static constexpr int CLIENT_VERSION
bitcoind-res.rc includes this file, but it cannot cope with real c++ code.
Definition: clientversion.h:44
FormatVersion
std::string FormatVersion(int nVersion)
Definition: clientversion.cpp:47
FormatUserAgent
std::string FormatUserAgent(const std::string &name, const std::string &version, const std::vector< std::string > &comments)
Format the subversion field according to BIP 14 spec.
Definition: clientversion.cpp:66