2017-12-29 06:13:28 +01:00
|
|
|
#ifdef _MSC_VER
|
2016-09-16 17:11:33 +02:00
|
|
|
#include <platform.h>
|
2017-12-29 06:13:28 +01:00
|
|
|
#endif
|
2016-09-15 20:11:38 +02:00
|
|
|
#include "version.h"
|
|
|
|
|
2016-09-16 16:54:41 +02:00
|
|
|
#include <stdio.h>
|
2016-09-16 17:08:03 +02:00
|
|
|
|
2016-09-15 20:11:38 +02:00
|
|
|
#ifndef ERESSEA_VERSION
|
2017-02-18 21:15:14 +01:00
|
|
|
/* 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"
|
2016-09-15 20:11:38 +02:00
|
|
|
#endif
|
|
|
|
|
|
|
|
const char *eressea_version(void) {
|
2017-01-30 10:35:52 +01:00
|
|
|
#ifdef ERESSEA_BUILDNO
|
|
|
|
return ERESSEA_VERSION "-" ERESSEA_BUILDNO;
|
2017-02-14 12:15:36 +01:00
|
|
|
#else
|
2016-09-15 20:11:38 +02:00
|
|
|
return ERESSEA_VERSION;
|
2017-02-14 12:15:36 +01:00
|
|
|
#endif
|
2016-09-15 20:11:38 +02:00
|
|
|
}
|
2016-09-16 16:54:41 +02:00
|
|
|
|
|
|
|
int version_no(const char *str) {
|
2017-01-30 10:35:52 +01:00
|
|
|
int maj = 0, min = 0, pat = 0;
|
2017-12-08 21:08:11 +01:00
|
|
|
sscanf(str, "%4d.%4d.%4d", &maj, &min, &pat);
|
2017-01-30 10:35:52 +01:00
|
|
|
return (maj << 16) | (min << 8) | pat;
|
2016-09-16 16:54:41 +02:00
|
|
|
}
|