server/src/kernel/version.c

28 lines
577 B
C
Raw Normal View History

#ifdef _MSC_VER
#include <platform.h>
#endif
#include "version.h"
2018-12-16 09:48:39 +01:00
#include <assert.h>
2016-09-16 16:54:41 +02:00
#include <stdio.h>
#ifndef ERESSEA_VERSION
/* the version number, if it was not passed to make with -D */
2020-06-15 20:08:32 +02:00
#define ERESSEA_VERSION "3.25.0"
#endif
const char *eressea_version(void) {
#ifdef ERESSEA_BUILDNO
return ERESSEA_VERSION "-" ERESSEA_BUILDNO;
2017-02-14 12:15:36 +01:00
#else
return ERESSEA_VERSION;
2017-02-14 12:15:36 +01:00
#endif
}
2016-09-16 16:54:41 +02:00
int version_no(const char *str) {
2018-12-15 20:12:53 +01:00
int c, maj = 0, min = 0, pat = 0;
c = sscanf(str, "%4d.%4d.%4d", &maj, &min, &pat);
assert(c == 3);
return (maj << 16) | (min << 8) | pat;
2016-09-16 16:54:41 +02:00
}