Files
GabsPuNs-Project_Zenith_Main/Minecraft.Client/compat_shims.cpp
2026-06-10 16:12:51 +02:00

80 lines
3.0 KiB
C++

#ifdef _MSC_VER
#pragma comment(lib, "legacy_stdio_definitions.lib")
#endif
namespace std {
char const* _Winerror_map(int) { return nullptr; }
}
// MinGW stubs for symbols missing from prebuilt 4JLibs .a files
#ifdef __GNUC__
#include <string>
#include <vector>
// Minimal forward declaration of C4JStorage for stub functions only.
// We cannot include 4J_Storage.h directly because it requires Xbox SDK headers.
class C4JStorage {
public:
std::string GetMountedPath(std::string szMount);
void GetMountedDLCFileList(const char* szMountDrive, std::vector<std::string>& fileList);
// DLC stubs
int GetInstalledDLC(int, int (*)(void*, int, int), void*);
int GetDLCOffers(int, int (*)(void*, int, unsigned long, int), void*, unsigned long);
void ClearDLCOffers();
unsigned long UnmountInstalledDLC(const char*);
unsigned long MountInstalledDLC(int, unsigned long, int (*)(void*, int, unsigned long, unsigned long), void*, const char*);
void* GetDLC(unsigned long);
void* GetOffer(unsigned long);
unsigned long InstallOffer(int, unsigned long long*, int (*)(void*, int, int), void*, bool);
int RenameSaveData(struct SAVE_INFO*, unsigned short*, int (*)(void*, bool), void*);
};
extern C4JStorage StorageManager;
// Minimal forward declaration of C4JRender for stub functions only.
class C4JRender {
public:
void EnableVsync();
void DisableVsync();
bool GetVsync();
const char* GetScreenshotPath();
};
extern C4JRender RenderManager;
void SeedEditBox() {}
// C4JStorage stubs
std::string C4JStorage::GetMountedPath(std::string szMount) { return szMount; }
void C4JStorage::GetMountedDLCFileList(const char*, std::vector<std::string>&) {}
int C4JStorage::GetInstalledDLC(int, int (*)(void*, int, int), void*) { return 0; }
int C4JStorage::GetDLCOffers(int, int (*)(void*, int, unsigned long, int), void*, unsigned long) { return 0; }
void C4JStorage::ClearDLCOffers() {}
unsigned long C4JStorage::UnmountInstalledDLC(const char*) { return 0; }
unsigned long C4JStorage::MountInstalledDLC(int, unsigned long, int (*)(void*, int, unsigned long, unsigned long), void*, const char*) { return 0; }
void* C4JStorage::GetDLC(unsigned long) { return nullptr; }
void* C4JStorage::GetOffer(unsigned long) { return nullptr; }
unsigned long C4JStorage::InstallOffer(int, unsigned long long*, int (*)(void*, int, int), void*, bool) { return 0; }
int C4JStorage::RenameSaveData(struct SAVE_INFO*, unsigned short*, int (*)(void*, bool), void*) { return 0; }
// C4JRender stubs for functions not present in MinGW 4J_Render_PC.a
void C4JRender::EnableVsync() {}
void C4JRender::DisableVsync() {}
bool C4JRender::GetVsync() { return false; }
const char* C4JRender::GetScreenshotPath() { return ""; }
// Discord stubs (C-linkage functions)
extern "C" {
void Discord_Initialize(const char*, void*, int, void*) {}
void Discord_Shutdown() {}
void Discord_RunCallbacks() {}
void Discord_UpdatePresence(void*) {}
}
// Static data members for AddEntityPacket/SkullTileEntity are now
// defined in Minecraft.World/StaticDataStubs.cpp
#endif