/ src / clientversion.h
clientversion.h
 1  // Copyright (c) 2009-present The Bitcoin Core developers
 2  // Distributed under the MIT software license, see the accompanying
 3  // file COPYING or http://www.opensource.org/licenses/mit-license.php.
 4  
 5  #ifndef BITCOIN_CLIENTVERSION_H
 6  #define BITCOIN_CLIENTVERSION_H
 7  
 8  #include <util/macros.h>
 9  
10  #include <bitcoin-build-config.h> // IWYU pragma: keep
11  
12  // Check that required client information is defined
13  #if !defined(CLIENT_VERSION_MAJOR) || !defined(CLIENT_VERSION_MINOR) || !defined(CLIENT_VERSION_BUILD) || !defined(CLIENT_VERSION_IS_RELEASE) || !defined(COPYRIGHT_YEAR)
14  #error Client version information missing: version is not defined by bitcoin-build-config.h or in any other way
15  #endif
16  
17  //! Copyright string used in Windows .rc files
18  #define COPYRIGHT_STR "2009-" STRINGIZE(COPYRIGHT_YEAR) " " COPYRIGHT_HOLDERS_FINAL
19  
20  // Windows .rc files include this header, but they cannot cope with real C++ code.
21  #if !defined(RC_INVOKED)
22  
23  #include <string>
24  #include <vector>
25  
26  static const int CLIENT_VERSION =
27                               10000 * CLIENT_VERSION_MAJOR
28                           +     100 * CLIENT_VERSION_MINOR
29                           +       1 * CLIENT_VERSION_BUILD;
30  
31  extern const std::string UA_NAME;
32  
33  
34  std::string FormatFullVersion();
35  std::string FormatSubVersion(const std::string& name, int nClientVersion, const std::vector<std::string>& comments);
36  
37  #endif // RC_INVOKED
38  
39  #endif // BITCOIN_CLIENTVERSION_H