diff options
author | Ben Longbons <b.r.longbons@gmail.com> | 2013-09-29 19:54:02 -0700 |
---|---|---|
committer | Ben Longbons <b.r.longbons@gmail.com> | 2013-09-30 17:23:30 -0700 |
commit | 9f438b1bccca459e484560232e5b6e7dfdbacd61 (patch) | |
tree | b8984d62a6efc36754477d3e4b16ff9fc2eef827 /src/common | |
parent | 7f2a6be58f6c100a8784e5cbca884108160c0f48 (diff) | |
download | tmwa-9f438b1bccca459e484560232e5b6e7dfdbacd61.tar.gz tmwa-9f438b1bccca459e484560232e5b6e7dfdbacd61.tar.bz2 tmwa-9f438b1bccca459e484560232e5b6e7dfdbacd61.tar.xz tmwa-9f438b1bccca459e484560232e5b6e7dfdbacd61.zip |
Automatically generate version information
Diffstat (limited to 'src/common')
-rw-r--r-- | src/common/version.cpp | 28 | ||||
-rw-r--r-- | src/common/version.hpp | 47 |
2 files changed, 36 insertions, 39 deletions
diff --git a/src/common/version.cpp b/src/common/version.cpp new file mode 100644 index 0000000..7f4a0f2 --- /dev/null +++ b/src/common/version.cpp @@ -0,0 +1,28 @@ +#include "version.hpp" + +#include "../conf/version.hpp" + +Version CURRENT_LOGIN_SERVER_VERSION = +{ + VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH, + VERSION_DEVEL, + + 0, TMWA_SERVER_LOGIN, + VENDOR_VERSION, +}; +Version CURRENT_CHAR_SERVER_VERSION = +{ + VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH, + VERSION_DEVEL, + + 0, TMWA_SERVER_CHAR | TMWA_SERVER_INTER, + VENDOR_VERSION, +}; +Version CURRENT_MAP_SERVER_VERSION = +{ + VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH, + VERSION_DEVEL, + + 0, TMWA_SERVER_MAP, + VENDOR_VERSION, +}; diff --git a/src/common/version.hpp b/src/common/version.hpp index 30c619c..e34ec50 100644 --- a/src/common/version.hpp +++ b/src/common/version.hpp @@ -1,14 +1,7 @@ -#ifndef VERSION_HPP -#define VERSION_HPP +#ifndef TMWA_COMMON_VERSION_HPP +#define TMWA_COMMON_VERSION_HPP -// TODO generate this from ./configure -// Actually, it should be done from the Makefile -// it should be possible to use a ./config.status for a long time - -# define TMWA_VERSION_MAJOR 13 -# define TMWA_VERSION_MINOR 9 -# define TMWA_VERSION_PATCH 29 -# define TMWA_DEVELOP_FLAG 1 +# include <cstdint> // TODO make these bitwise enums # define TMWA_FLAG_REGISTRATION 0x01 @@ -18,9 +11,6 @@ # define TMWA_SERVER_INTER 0x04 # define TMWA_SERVER_MAP 0x08 -# define TMWA_VENDOR "Vanilla" -# define TMWA_VENDOR_VERSION 0 - struct Version { uint8_t major; @@ -33,31 +23,10 @@ struct Version uint16_t vend; // can't add vendor name yet }; -static_assert(sizeof(Version) == 8, "this is send over the network, can't change"); - -constexpr Version CURRENT_LOGIN_SERVER_VERSION = -{ - TMWA_VERSION_MAJOR, TMWA_VERSION_MINOR, TMWA_VERSION_PATCH, - TMWA_DEVELOP_FLAG, +static_assert(sizeof(Version) == 8, "this is sent over the network, can't change"); - 0, TMWA_SERVER_LOGIN, - TMWA_VENDOR_VERSION, -}; -constexpr Version CURRENT_CHAR_SERVER_VERSION = -{ - TMWA_VERSION_MAJOR, TMWA_VERSION_MINOR, TMWA_VERSION_PATCH, - TMWA_DEVELOP_FLAG, - - 0, TMWA_SERVER_CHAR | TMWA_SERVER_INTER, - TMWA_VENDOR_VERSION, -}; -constexpr Version CURRENT_MAP_SERVER_VERSION = -{ - TMWA_VERSION_MAJOR, TMWA_VERSION_MINOR, TMWA_VERSION_PATCH, - TMWA_DEVELOP_FLAG, - - 0, TMWA_SERVER_MAP, - TMWA_VENDOR_VERSION, -}; +extern Version CURRENT_LOGIN_SERVER_VERSION; +extern Version CURRENT_CHAR_SERVER_VERSION; +extern Version CURRENT_MAP_SERVER_VERSION; -#endif // VERSION_HPP +#endif // TMWA_COMMON_VERSION_HPP |