mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-12-08 17:04:55 +00:00
Additional runtime stubs
This commit is contained in:
@@ -4,25 +4,13 @@
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "RetroTemplates.hpp"
|
||||
|
||||
#include <Athena/IStreamReader.hpp>
|
||||
#include <Athena/IStreamWriter.hpp>
|
||||
using CInputStream = Athena::io::IStreamReader;
|
||||
using COutputStream = Athena::io::IStreamWriter;
|
||||
|
||||
template<class T>
|
||||
class TOneStatic
|
||||
{
|
||||
static T m_allocspace;
|
||||
static uint32_t m_refCount;
|
||||
public:
|
||||
static T* GetAllocSpace() {return &m_allocspace;}
|
||||
static uint32_t& ReferenceCount() {return m_refCount;}
|
||||
void* operator new(size_t) {++ReferenceCount(); return GetAllocSpace();}
|
||||
void operator delete(void*) {--ReferenceCount();}
|
||||
};
|
||||
template<class T> T TOneStatic<T>::m_allocspace;
|
||||
template<class T> uint32_t TOneStatic<T>::m_refCount;
|
||||
|
||||
class CBasics
|
||||
{
|
||||
public:
|
||||
|
||||
Reference in New Issue
Block a user