summaryrefslogtreecommitdiff
path: root/other
diff options
context:
space:
mode:
authorMaxim Biro <nurupo.contributions@gmail.com>2018-04-16 23:43:28 -0400
committerMaxim Biro <nurupo.contributions@gmail.com>2018-06-25 00:29:16 -0400
commit7684b5ae3eaabec8fac035752fff30c651109dfc (patch)
tree16238b16e3b971a8e254cb59f8f72ad2978a4064 /other
parent29b2dd6315ffe29cd212c4d5a846479f56b33d52 (diff)
Make bootstrap daemon use toxcore's version
Diffstat (limited to 'other')
-rw-r--r--other/bootstrap_daemon/src/global.h27
1 files changed, 26 insertions, 1 deletions
diff --git a/other/bootstrap_daemon/src/global.h b/other/bootstrap_daemon/src/global.h
index ec579364..40a13c50 100644
--- a/other/bootstrap_daemon/src/global.h
+++ b/other/bootstrap_daemon/src/global.h
@@ -25,8 +25,33 @@
25#ifndef GLOBAL_H 25#ifndef GLOBAL_H
26#define GLOBAL_H 26#define GLOBAL_H
27 27
28#include "../../../toxcore/tox.h"
29
28#define DAEMON_NAME "tox-bootstrapd" 30#define DAEMON_NAME "tox-bootstrapd"
29#define DAEMON_VERSION_NUMBER 2016010100UL // yyyymmmddvv format: yyyy year, mm month, dd day, vv version change count for that day 31
32#define DAEMON_VERSION_MAJOR TOX_VERSION_MAJOR
33#define DAEMON_VERSION_MINOR TOX_VERSION_MINOR
34#define DAEMON_VERSION_PATCH TOX_VERSION_PATCH
35
36// Make sure versions are within the limit
37#define VERSION_IS_OK(NUM) ( NUM >= 0 && NUM <= 999 )
38#if !VERSION_IS_OK(DAEMON_VERSION_MAJOR) || !VERSION_IS_OK(DAEMON_VERSION_MINOR) || !VERSION_IS_OK(DAEMON_VERSION_PATCH)
39#error "At least one of major, minor or patch parts of the version is out of bounds of [0, 999]. Current version: " DAEMON_VERSION_MAJOR "." DAEMON_VERSION_MINOR "." DAEMON_VERSION_PATCH
40#endif
41#undef VERSION_IS_OK
42
43// New version scheme of 1AAABBBCCC, where A B and C are major, minor and patch
44// versions of toxcore. The leading 1 is there just to keep the leading zeros,
45// so that it would be easier to read the version when printed as a number.
46// The version is in a visual decimal format rather than in any other format,
47// because the original version was using a similar format, it was using
48// YYYYMMDDVV date-based format for the version, with VV being an incremental
49// counter in case more than one version was released at that day. Due to this
50// some tools started showing the version to users as a plain number, rather
51// than some binary format that needs to be parsed before being shown to users
52// so we decided to keep this display format compatibility and adopted this
53// weird scheme with a leading 1.
54#define DAEMON_VERSION_NUMBER 1000000000UL + DAEMON_VERSION_MAJOR*1000000UL + DAEMON_VERSION_MINOR*1000UL + DAEMON_VERSION_PATCH*1UL
30 55
31#define MIN_ALLOWED_PORT 1 56#define MIN_ALLOWED_PORT 1
32#define MAX_ALLOWED_PORT 65535 57#define MAX_ALLOWED_PORT 65535