Got it working on Windows using Mingw

This commit is contained in:
2024-12-29 21:44:33 -06:00
parent 5b89d8c5de
commit f1bae988c4
15 changed files with 139 additions and 33 deletions

View File

@ -1,11 +1,15 @@
#pragma once
#include "VFS.hpp"
#include "VFSFix.hpp"
namespace Tesses::Framework::Filesystem
{
class LocalFilesystem : public VFS
{
public:
Tesses::Framework::Streams::Stream* OpenFile(VFSPath path, std::string mode);
void CreateDirectory(VFSPath path);
void DeleteDirectory(VFSPath path);
bool RegularFileExists(VFSPath path);
@ -15,11 +19,14 @@ namespace Tesses::Framework::Filesystem
bool SocketFileExists(VFSPath path);
bool FIFOFileExists(VFSPath path);
bool DirectoryExists(VFSPath path);
void DeleteFile(VFSPath path);
void CreateSymlink(VFSPath existingFile, VFSPath symlinkFile);
VFSPathEnumerator EnumeratePaths(VFSPath path);
void CreateHardlink(VFSPath existingFile, VFSPath newName);
void MoveFile(VFSPath src, VFSPath dest);
void MoveDirectory(VFSPath src, VFSPath dest);
VFSPath ReadLink(VFSPath path);
std::string VFSPathToSystem(VFSPath path);

View File

@ -1,5 +1,7 @@
#pragma once
#include "VFS.hpp"
#include "VFSFix.hpp"
namespace Tesses::Framework::Filesystem
{
class MountableDirectory {

View File

@ -1,5 +1,7 @@
#pragma once
#include "VFS.hpp"
#include "VFSFix.hpp"
namespace Tesses::Framework::Filesystem
{
class NullFilesystem : public VFS

View File

@ -1,5 +1,7 @@
#pragma once
#include "VFS.hpp"
#include "VFSFix.hpp"
namespace Tesses::Framework::Filesystem
{
class SubdirFilesystem : public VFS

View File

@ -3,6 +3,8 @@
#include "../Streams/Stream.hpp"
#include <functional>
#include <memory>
#include "VFSFix.hpp"
namespace Tesses::Framework::Filesystem
{
class VFSPath {

View File

@ -1,5 +1,7 @@
#pragma once
#if defined(GEKKO)
#if defined(_WIN32)
#include <windows.h>
#elif defined(GEKKO)
#include <ogc/mutex.h>
#else
#include <threads.h>
@ -7,7 +9,9 @@
namespace Tesses::Framework::Threading
{
class Mutex {
#if defined(GEKKO)
#if defined(_WIN32)
HANDLE mtx;
#elif defined(GEKKO)
mutex_t mtx;
#else
mtx_t mtx;

View File

@ -1,6 +1,8 @@
#pragma once
#include <functional>
#if defined(GEKKO)
#if defined(_WIN32)
#include <windows.h>
#elif defined(GEKKO)
#include <ogc/lwp.h>
#else
#include <threads.h>
@ -10,8 +12,13 @@ namespace Tesses::Framework::Threading
{
class Thread
{
std::atomic<bool> hasInvoked;
#if defined(GEKKO)
#if defined(_WIN32)
HANDLE thrd;
DWORD thrdId;
public:
#elif defined(GEKKO)
lwp_t thrd;
static void* cb(void* ptr);
#else
@ -19,6 +26,8 @@ namespace Tesses::Framework::Threading
static int cb(void* ptr);
#endif
std::function<void()> fn;
std::atomic<bool> hasInvoked;
public:
Thread(std::function<void()> fn);
void Join();