You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

clientversion.h 1.9KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. // Copyright (c) 2009-2016 The Starwels developers
  2. // Distributed under the MIT software license, see the accompanying
  3. // file COPYING or http://www.opensource.org/licenses/mit-license.php.
  4. #ifndef STARWELS_CLIENTVERSION_H
  5. #define STARWELS_CLIENTVERSION_H
  6. #if defined(HAVE_CONFIG_H)
  7. #include "config/starwels-config.h"
  8. #endif //HAVE_CONFIG_H
  9. // Check that required client information is defined
  10. #if !defined(CLIENT_VERSION_MAJOR) || !defined(CLIENT_VERSION_MINOR) || !defined(CLIENT_VERSION_REVISION) || !defined(CLIENT_VERSION_BUILD) || !defined(CLIENT_VERSION_IS_RELEASE) || !defined(COPYRIGHT_YEAR)
  11. #error Client version information missing: version is not defined by starwels-config.h or in any other way
  12. #endif
  13. /**
  14. * Converts the parameter X to a string after macro replacement on X has been performed.
  15. * Don't merge these into one macro!
  16. */
  17. #define STRINGIZE(X) DO_STRINGIZE(X)
  18. #define DO_STRINGIZE(X) #X
  19. //! Copyright string used in Windows .rc files
  20. #define COPYRIGHT_STR "2009-" STRINGIZE(COPYRIGHT_YEAR) " " COPYRIGHT_HOLDERS_FINAL
  21. /**
  22. * starwelsd-res.rc includes this file, but it cannot cope with real c++ code.
  23. * WINDRES_PREPROC is defined to indicate that its pre-processor is running.
  24. * Anything other than a define should be guarded below.
  25. */
  26. #if !defined(WINDRES_PREPROC)
  27. #include <string>
  28. #include <vector>
  29. static const int CLIENT_VERSION =
  30. 1000000 * CLIENT_VERSION_MAJOR
  31. + 10000 * CLIENT_VERSION_MINOR
  32. + 100 * CLIENT_VERSION_REVISION
  33. + 1 * CLIENT_VERSION_BUILD;
  34. extern const std::string CLIENT_NAME;
  35. extern const std::string CLIENT_BUILD;
  36. std::string FormatFullVersion();
  37. std::string FormatSubVersion(const std::string& name, int nClientVersion, const std::vector<std::string>& comments);
  38. #endif // WINDRES_PREPROC
  39. #endif // STARWELS_CLIENTVERSION_H