Update config.h to use a .cpp file that will be recompiled when it changes
This commit is contained in:
parent
15883c2dd3
commit
6967fa9117
@ -1,23 +1,5 @@
|
||||
#ifndef STRINGIZE
|
||||
#define STRINGIZE(x) #x
|
||||
#endif
|
||||
#pragma once
|
||||
|
||||
#ifndef STRINGIZE_VALUE_OF
|
||||
#define STRINGIZE_VALUE_OF(x) STRINGIZE(x)
|
||||
#endif
|
||||
|
||||
#ifndef MOON_MAJOR
|
||||
#define MOON_MAJOR 0
|
||||
#endif
|
||||
|
||||
#ifndef MOON_MINOR
|
||||
#define MOON_MINOR 3
|
||||
#endif
|
||||
|
||||
#ifndef MOON_SUFFIX
|
||||
#ifndef _MOON_SUFFIX
|
||||
#define MOON_SUFFIX ""
|
||||
#else
|
||||
#define MOON_SUFFIX STRINGIZE_VALUE_OF(_MOON_SUFFIX)
|
||||
#endif
|
||||
#endif
|
||||
int __moon_version_major();
|
||||
int __moon_version_minor();
|
||||
const char* __moon_version_suffix();
|
31
kernel/src/config.cpp
Normal file
31
kernel/src/config.cpp
Normal file
@ -0,0 +1,31 @@
|
||||
#include "config.h"
|
||||
|
||||
#define STRINGIZE(x) #x
|
||||
#define STRINGIZE_VALUE_OF(x) STRINGIZE(x)
|
||||
|
||||
int __moon_version_major()
|
||||
{
|
||||
#ifndef MOON_MAJOR
|
||||
return 0;
|
||||
#else
|
||||
return MOON_MAJOR;
|
||||
#endif
|
||||
}
|
||||
|
||||
int __moon_version_minor()
|
||||
{
|
||||
#ifndef MOON_MINOR
|
||||
return 3;
|
||||
#else
|
||||
return MOON_MINOR;
|
||||
#endif
|
||||
}
|
||||
|
||||
const char* __moon_version_suffix()
|
||||
{
|
||||
#ifndef _MOON_SUFFIX
|
||||
return "";
|
||||
#else
|
||||
return STRINGIZE_VALUE_OF(_MOON_SUFFIX);
|
||||
#endif
|
||||
}
|
@ -32,7 +32,7 @@ extern "C" void _start()
|
||||
Init::disable_smp(); // Put all other cores except the bootstrap one in an infinite loop
|
||||
Init::early_init();
|
||||
|
||||
kinfoln("Starting Moon %d.%d%s", MOON_MAJOR, MOON_MINOR, MOON_SUFFIX);
|
||||
kinfoln("Starting Moon %d.%d%s", __moon_version_major(), __moon_version_minor(), __moon_version_suffix());
|
||||
|
||||
CPU::log_cpu_information();
|
||||
|
||||
|
@ -43,7 +43,7 @@ void Mersenne::init()
|
||||
has_rdrand = CPU::has_feature(CPU::Features::RDRAND);
|
||||
has_rdseed = asm_test_rdseed();
|
||||
|
||||
state ^= (0x45fe1024UL + MOON_MAJOR) * (MOON_MINOR ^ 200UL);
|
||||
state ^= (0x45fe1024UL + __moon_version_major()) * (__moon_version_minor() ^ 200UL);
|
||||
|
||||
state ^= 0xe0e4f5332ea75b;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user