152 lines
6.1 KiB
C++
152 lines
6.1 KiB
C++
/***
|
|
Copyright (C) 2021 J Reece Wilson (a/k/a "Reece"). All rights reserved.
|
|
|
|
File: Runtime.hpp
|
|
Date: 2021-6-9
|
|
Author: Reece
|
|
***/
|
|
#pragma once
|
|
|
|
#if defined(AURORA_ENGINE_KERNEL_STATIC)
|
|
#define AUKN_SYM
|
|
#else
|
|
#if defined(AURORA_ENGINE_KERNEL_EXPORT)
|
|
#define AUKN_SYM AURORA_SYMBOL_EXPORT
|
|
#else
|
|
#define AUKN_SYM AURORA_SYMBOL_IMPORT
|
|
#endif
|
|
#endif
|
|
|
|
#include <auROXTL.hpp>
|
|
|
|
#if defined(_AUHAS_FMT)
|
|
#include <fmt/core.h>
|
|
#include <fmt/format.h>
|
|
#include <fmt/chrono.h>
|
|
#include <fmt/ranges.h>
|
|
#endif
|
|
|
|
#if !defined(_AUHAS_UUID)
|
|
#error Missing stduuid library
|
|
#endif
|
|
#include <uuid.h>
|
|
|
|
#if defined(AURORA_COMPILER_CLANG) || defined(AURORA_COMPILER_GCC)
|
|
// Fuck you Clang, you can suck my dick
|
|
// Yes, this will infest every project that includes AuroraRuntime.hpp.
|
|
// No, I dont care.
|
|
// Stop adding retarded screeching warnings over stylistic choices.
|
|
// This use-case goes beyond the clangIgnore fields of our build scripts.
|
|
// We shouldn't need or desire viral/include-recursive warning dismissal, yet here we are.
|
|
#pragma clang diagnostic ignored "-Wbraced-scalar-init"
|
|
|
|
// Consider: VIS void MyFunc(int a, int b = { 2 }, int c = { 3 })
|
|
// Consider: how much legacy C code used { NULL [, ...] } as a generic initializer of member pointers *and integers*
|
|
// Consider: MaybeUsignedLongLongOrMaybeInt2048ClassOrMaybeBigIntClassOrMaybeEndianWrapper_t someValue = { 0 }
|
|
// Why the hell should this resort in screeching from every translation unit parsing the runtimes' API?
|
|
// ...why should I care *NOT TO* sneak in additional universal warning ignores when this is the absolute state of clang and gcc?
|
|
// ...i'm not infecting my (and others') buildchain[s] with retarded piss, nor am i going to give a shit about your obsession with pragmatic build warnings (-Wall -pedantic, etc), in the face of these dog-shit compilers.
|
|
// Who thought Type value = { 0 } should be a fucking error in boomer corps, and a warning in the best case scenario? who?
|
|
#endif
|
|
|
|
#define AUKN_SHARED_API(name, type, ...) AU_SHARED_API_EX(AUKN_SYM, name, type, ## __VA_ARGS__)
|
|
#define AUKN_SHARED_SOO(name, type, size, ...) AUKN_SHARED_API(name, type, ## __VA_ARGS__) AUROXTL_INTERFACE_SOO_HDR_EX(AUKN_SYM, name, type, size)
|
|
#define AUKN_SHARED_SOO_NC(name, type, size, ...) AUKN_SHARED_API(name, type, ## __VA_ARGS__) AUROXTL_INTERFACE_SOO_HDR_EX_NC(AUKN_SYM, name, type, size)
|
|
#define AUKN_SHARED_SOO_CC(name, type, size, ...) AUKN_SHARED_API(name, type, ## __VA_ARGS__) AUROXTL_INTERFACE_SOO_HDR_EX_CC(AUKN_SYM, name, type, size)
|
|
#define AUKN_SHARED_SOO_CCNM(name, type, size, ...) AUKN_SHARED_API(name, type, ## __VA_ARGS__) AUROXTL_INTERFACE_SOO_HDR_EX_CCNM(AUKN_SYM, name, type, size)
|
|
#define AUKN_SHARED_SOO_NCM(name, type, size, ...) AUKN_SHARED_API(name, type, ## __VA_ARGS__) AUROXTL_INTERFACE_SOO_HDR_EX_NCM(AUKN_SYM, name, type, size)
|
|
#define AUKN_SHARED_SOO2(name, type, size, ctrs, ...) AUKN_SHARED_API(name, type, ## __VA_ARGS__) AUROXTL_INTERFACE_SOO_HDR_EX(AUKN_SYM, name, type, size, AU_STRIP_BRACKETS(ctrs))
|
|
#define AUKN_SHARED_SOO2_NC(name, type, size, ctrs, ...) AUKN_SHARED_API(name, type, ## __VA_ARGS__) AUROXTL_INTERFACE_SOO_HDR_EX_NC(AUKN_SYM, name, type, size, AU_STRIP_BRACKETS(ctrs))
|
|
#define AUKN_SHARED_SOO2_NCM(name, type, size, ctrs, ...) AUKN_SHARED_API(name, type, ## __VA_ARGS__) AUROXTL_INTERFACE_SOO_HDR_EX_NCM(AUKN_SYM, name, type, size, AU_STRIP_BRACKETS(ctrs))
|
|
|
|
#if defined(_AURORA_RUNTIME_BUILD_API_INTERFACES)
|
|
#define AUKN_INTERFACE AUI_INTERFACE_IMPL
|
|
#define AUKN_INTERFACE_EXT AUI_INTERFACE_EXT_IMPL
|
|
#else
|
|
#define AUKN_INTERFACE AUI_INTERFACE_FWD
|
|
#define AUKN_INTERFACE_EXT AUI_INTERFACE_EXT_FWD
|
|
#endif
|
|
|
|
#if defined(AURORA_COMPILER_MSVC) && !defined(MemoryBarrier)
|
|
#define AURORA_COMPILER_VOLATILE_BARRIER() __faststorefence()
|
|
#elif defined(MemoryBarrier)
|
|
#define AURORA_COMPILER_VOLATILE_BARRIER() MemoryBarrier()
|
|
#else
|
|
#define AURORA_COMPILER_VOLATILE_BARRIER() asm volatile ("" : : : "memory")
|
|
#endif
|
|
|
|
#include "Memory/Memory.hpp"
|
|
|
|
#include "Utility/PrivData.hpp"
|
|
|
|
#include "Console/Console.hpp"
|
|
#include "Logging/Logging.hpp"
|
|
#include "Crypto/Crypto.hpp"
|
|
#include "Compression/Compression.hpp"
|
|
#include "Data/Data.hpp"
|
|
#include "Debug/Debug.hpp"
|
|
#include "Hashing/Hashing.hpp"
|
|
#include "HWInfo/HWInfo.hpp"
|
|
#include "IO/IO.hpp"
|
|
#include "Time/Time.hpp"
|
|
#include "Locale/Locale.hpp"
|
|
#include "Parse/Parse.hpp"
|
|
#include "Process/Process.hpp"
|
|
#include "Registry/Registry.hpp"
|
|
#include "RNG/RNG.hpp"
|
|
#include "Telemetry/Telemetery.hpp"
|
|
#include "Threading/Threading.hpp"
|
|
#include "Async/Async.hpp"
|
|
#include "Processes/Processes.hpp"
|
|
#include "IO/Loop/Loop.hpp"
|
|
#include "IO/IPC/IPC.hpp"
|
|
#include "SWInfo/SWInfo.hpp"
|
|
#include "Exit/Exit.hpp"
|
|
#include "CmdLine/CmdLine.hpp"
|
|
#include "Utility/RateLimiter.hpp"
|
|
#include "Memory/_ByteBuffer.hpp"
|
|
#include "Utility/DestructionWatch.hpp"
|
|
|
|
#include "RuntimeAliases.hpp"
|
|
|
|
#include "Aurora/Async/AuFutures.hpp"
|
|
|
|
#include "RuntimeConfig.hpp"
|
|
|
|
namespace Aurora
|
|
{
|
|
/**
|
|
* @brief Initializes Aurora Runtime for the first and only time
|
|
* @return
|
|
*/
|
|
AUKN_SYM void RuntimeStart(const RuntimeStartInfo &info);
|
|
|
|
/**
|
|
* @brief Querys the state of the DLL or Static Library
|
|
* @return true after at least one RuntimeStart
|
|
*/
|
|
AUKN_SYM bool RuntimeHasStarted();
|
|
|
|
/**
|
|
* @brief You have **one** opportunity to swap the system locality before it locked
|
|
* This can be used by platform gems to align the runtime language and decimal dot notation to a given locality
|
|
* @return
|
|
*/
|
|
AUKN_SYM void RuntimeOverloadLocality(const AuPair<AuString, AuString> &locality);
|
|
|
|
/**
|
|
* @brief Cleans up Aurora Runtime regardless of the count of calls to RuntimeShutdown or RuntimeStart
|
|
* @return
|
|
*/
|
|
AUKN_SYM void RuntimeShutdown();
|
|
|
|
/**
|
|
* @brief Single threaded main pump for GUI applications polling for non-async subsystem callbacks
|
|
* (primarily legacy command dispatch)
|
|
* @deprecated
|
|
* @return
|
|
*/
|
|
AUKN_SYM void RuntimeSysPump();
|
|
|
|
AUKN_SYM void RuntimeWaitForSecondaryTick();
|
|
} |