server/src/kernel/version.c

24 lines
504 B
C
Raw Normal View History

#include <platform.h>
#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 */
#define ERESSEA_VERSION "3.11.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, "%d.%d.%d", &maj, &min, &pat);
return (maj << 16) | (min << 8) | pat;
2016-09-16 16:54:41 +02:00
}