61 lines
1.3 KiB
C++
61 lines
1.3 KiB
C++
/***
|
|
Copyright (C) 2022 J Reece Wilson (a/k/a "Reece"). All rights reserved.
|
|
|
|
File: AuSWInfo.cpp
|
|
Date: 2022-1-25
|
|
Author: Reece
|
|
***/
|
|
#include <Source/RuntimeInternal.hpp>
|
|
#include "AuSWInfo.hpp"
|
|
|
|
#if defined(AURORA_IS_MODERNNT_DERIVED)
|
|
#include "AuSWInfo.NT.hpp"
|
|
#endif
|
|
|
|
#if defined(AURORA_IS_LINUX_DERIVED)
|
|
#include "AuSWInfo.Linux.hpp"
|
|
#endif
|
|
|
|
namespace Aurora::SWInfo
|
|
{
|
|
static const AuString kDefaultStr;
|
|
static const OSInformation kDefaultInfo;
|
|
static OSInformation const *gInfo = &kDefaultInfo;
|
|
static OSInformation gTempInfo;
|
|
|
|
static void Reset()
|
|
{
|
|
gInfo = &kDefaultInfo;
|
|
}
|
|
|
|
AUKN_SYM const OSInformation &GetPlatformInfo()
|
|
{
|
|
SysAssert(gInfo, "No Platform Information Initialized");
|
|
return *gInfo;
|
|
}
|
|
|
|
void InitSwInfo()
|
|
{
|
|
Reset();
|
|
|
|
#if defined(AURORA_IS_MODERNNT_DERIVED)
|
|
InitNTInfo(gTempInfo);
|
|
#endif
|
|
|
|
#if defined(AURORA_IS_LINUX_DERIVED)
|
|
InitLinuxInfo(gTempInfo);
|
|
#endif
|
|
|
|
gTempInfo.ePlatform = Build::kCurrentPlatform;
|
|
gInfo = &gTempInfo;
|
|
}
|
|
|
|
void InitSwInfoEarly()
|
|
{
|
|
#if defined(AURORA_IS_MODERNNT_DERIVED)
|
|
InitNTInfoNoAllocate(gTempInfo);
|
|
gTempInfo.ePlatform = Build::kCurrentPlatform;
|
|
gInfo = &gTempInfo;
|
|
#endif
|
|
}
|
|
} |