apio
1f655fabe2
Right now the kernel is the only thing with a version number, the user apps just fetch it from the kernel using the sys_getversion() syscall
38 lines
592 B
C++
38 lines
592 B
C++
#include "config.h"
|
|
|
|
#define STRINGIZE(x) #x
|
|
#define STRINGIZE_VALUE_OF(x) STRINGIZE(x)
|
|
|
|
#ifndef MOON_MAJOR
|
|
#define MOON_MAJOR 0
|
|
#endif
|
|
|
|
#ifndef MOON_MINOR
|
|
#define MOON_MINOR 10
|
|
#endif
|
|
|
|
#ifndef _MOON_SUFFIX
|
|
#define MOON_SUFFIX ""
|
|
#else
|
|
#define MOON_SUFFIX STRINGIZE_VALUE_OF(_MOON_SUFFIX)
|
|
#endif
|
|
|
|
int __moon_version_major()
|
|
{
|
|
return MOON_MAJOR;
|
|
}
|
|
|
|
int __moon_version_minor()
|
|
{
|
|
return MOON_MINOR;
|
|
}
|
|
|
|
const char* __moon_version_suffix()
|
|
{
|
|
return MOON_SUFFIX;
|
|
}
|
|
|
|
const char* moon_version()
|
|
{
|
|
return STRINGIZE_VALUE_OF(MOON_MAJOR) "." STRINGIZE_VALUE_OF(MOON_MINOR) MOON_SUFFIX;
|
|
} |