oxen-core/src/version.cpp.in
Jason Rhinelander 8a276b362f Store loki version as std::array<u16,3> everywhere
Currently we store it as various different things: 3 separate ints, 2
u16s, 3 separate u16s, and a vector of u16s.  This unifies all version
values to a `std::array<uint16_t,3>`.

- LOKI_VERSION_{MAJOR,MINOR,PATCH} are now just LOKI_VERSION
- The previous LOKI_VERSION (C-string of the version) is now renamed
  LOKI_VERSION_STR

A related change included here is that the restricted RPC now returns
the major version in the get_info rpc call instead of an empty string
(e.g. "5" instead of "").  There is almost certainly enough difference
in the RPC results to distinguish major versions already so this doesn't
seem like it actually leaks anything significant.
2019-11-27 14:07:52 -04:00

21 lines
884 B
C++

#define DEF_LOKI_VERSION_MAJOR 5
#define DEF_LOKI_VERSION_MINOR 1
#define DEF_LOKI_VERSION_PATCH 3
#define LOKI_STRINGIFY2(val) #val
#define LOKI_STRINGIFY(val) LOKI_STRINGIFY2(val)
#define DEF_LOKI_VERSION_STR LOKI_STRINGIFY(DEF_LOKI_VERSION_MAJOR) "." LOKI_STRINGIFY(DEF_LOKI_VERSION_MINOR) "." LOKI_STRINGIFY(DEF_LOKI_VERSION_PATCH)
#define DEF_LOKI_VERSION_TAG "@VERSIONTAG@"
#define DEF_LOKI_RELEASE_NAME "Trusty Tyr"
#define DEF_LOKI_VERSION_FULL DEF_LOKI_VERSION_STR "-" DEF_LOKI_VERSION_TAG
#include "version.h"
const std::array<uint16_t, 3> LOKI_VERSION = {DEF_LOKI_VERSION_MAJOR, DEF_LOKI_VERSION_MINOR, DEF_LOKI_VERSION_PATCH};
const char* const LOKI_VERSION_TAG = DEF_LOKI_VERSION_TAG;
const char* const LOKI_VERSION_STR = DEF_LOKI_VERSION_STR;
const char* const LOKI_RELEASE_NAME = DEF_LOKI_RELEASE_NAME;
const char* const LOKI_VERSION_FULL = DEF_LOKI_VERSION_FULL;