Allow building with older GCC

This commit is contained in:
Simon Lindholm 2022-07-04 19:27:23 +02:00
parent 228bf4663e
commit a47a2e5e8b
2 changed files with 4 additions and 2 deletions

View File

@ -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

View File

@ -1,5 +1,6 @@
#include "common.h"
#include "files.h"
#include <algorithm>
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);
}