server/src/kernel/version.c

26 lines
530 B
C
Raw Normal View History

#ifdef _MSC_VER
#include <platform.h>
#endif
#include "version.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 */
2018-11-27 22:20:30 +01:00
#define ERESSEA_VERSION "3.19.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) {
int maj = 0, min = 0, pat = 0;
sscanf(str, "%4d.%4d.%4d", &maj, &min, &pat);
return (maj << 16) | (min << 8) | pat;
2016-09-16 16:54:41 +02:00
}