forked from github/server
4e5f1d05ce
Compile with -std=c89 in gcc. remove all // comments (they are nice, but unnecessary). variables only declared at start of block. various pedantery. backwards compatible va_copy for pre-C99 gcc.
23 lines
504 B
C
23 lines
504 B
C
#include <platform.h>
|
|
#include "version.h"
|
|
|
|
#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;
|
|
#else
|
|
return ERESSEA_VERSION;
|
|
#endif
|
|
}
|
|
|
|
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;
|
|
}
|