diff --git a/Makefile b/Makefile index dc25bb9..9baf6a6 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,7 @@ all: wibo CXXFLAGS = -Wall -g -m32 -std=c++2a -lstdc++ -MD +LDFLAGS = -lstdc++fs BUILD_DIR := build CPP_FILES := $(wildcard *.cpp) @@ -14,7 +15,7 @@ $(BUILD_DIR)/%.o: %.cpp | $(BUILD_DIR) $(CXX) -c $(CXXFLAGS) $< -o $@ wibo: $(O_FILES) - $(CXX) $(CXXFLAGS) $^ -o $@ + $(CXX) $(CXXFLAGS) $^ -o $@ $(LDFLAGS) clean: $(RM) -r $(BUILD_DIR) wibo diff --git a/files.cpp b/files.cpp index 0a574b9..c52c6d2 100644 --- a/files.cpp +++ b/files.cpp @@ -1,5 +1,6 @@ #include "common.h" #include "files.h" +#include namespace files { static FILE *handleFps[0x10000]; @@ -14,7 +15,7 @@ namespace files { std::replace(str.begin(), str.end(), '\\', '/'); // Remove the drive letter - if (str.starts_with("c:/") || str.starts_with("C:/")) { + if (str.rfind("c:/", 0) == 0 || str.rfind("C:/", 0) == 0) { str.erase(0, 2); }