clientversion.h raw

   1  // Copyright (c) 2009-2022 The Limenka 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 LIMENKA_CLIENTVERSION_H
   6  #define LIMENKA_CLIENTVERSION_H
   7  
   8  #include <util/macros.h>
   9  
  10  #include <limenka-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 limenka-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  /**
  21   * limenkad-res.rc includes this file, but it cannot cope with real c++ code.
  22   * WINDRES_PREPROC is defined to indicate that its pre-processor is running.
  23   * Anything other than a define should be guarded below.
  24   */
  25  
  26  #if !defined(WINDRES_PREPROC)
  27  
  28  #include <cstdint>
  29  #include <string>
  30  #include <vector>
  31  
  32  static const int CLIENT_VERSION =
  33                               10000 * CLIENT_VERSION_MAJOR
  34                           +     100 * CLIENT_VERSION_MINOR
  35                           +       1 * CLIENT_VERSION_BUILD;
  36  
  37  extern const std::string UA_NAME;
  38  
  39  
  40  std::string FormatFullVersion();
  41  std::string FormatSubVersion(const std::string& name, int nClientVersion, const std::vector<std::string>& comments, bool base_name_only = false);
  42  
  43  std::string CopyrightHolders(const std::string& strPrefix);
  44  
  45  /** Returns licensing information (for -version) */
  46  std::string LicenseInfo();
  47  
  48  
  49  
  50  #endif // WINDRES_PREPROC
  51  
  52  #endif // LIMENKA_CLIENTVERSION_H
  53