mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/4jcraft.git
synced 2026-06-24 19:35:33 +00:00
refactor: use function-local statics for platform accessors to dodge SIOF
This commit is contained in:
@@ -6,8 +6,12 @@
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
StdFilesystem std_filesystem_instance;
|
||||
IPlatformFilesystem& PlatformFilesystem = std_filesystem_instance;
|
||||
namespace platform_internal {
|
||||
IPlatformFilesystem& PlatformFilesystem_get() {
|
||||
static StdFilesystem instance;
|
||||
return instance;
|
||||
}
|
||||
}
|
||||
|
||||
IPlatformFilesystem::ReadResult StdFilesystem::readFile(const std::filesystem::path& path,
|
||||
void* buffer, std::size_t capacity) {
|
||||
|
||||
Reference in New Issue
Block a user