mirror of https://github.com/decompals/wibo.git
Allow building with older GCC
This commit is contained in:
parent
228bf4663e
commit
a47a2e5e8b
3
Makefile
3
Makefile
|
@ -1,6 +1,7 @@
|
||||||
all: wibo
|
all: wibo
|
||||||
|
|
||||||
CXXFLAGS = -Wall -g -m32 -std=c++2a -lstdc++ -MD
|
CXXFLAGS = -Wall -g -m32 -std=c++2a -lstdc++ -MD
|
||||||
|
LDFLAGS = -lstdc++fs
|
||||||
|
|
||||||
BUILD_DIR := build
|
BUILD_DIR := build
|
||||||
CPP_FILES := $(wildcard *.cpp)
|
CPP_FILES := $(wildcard *.cpp)
|
||||||
|
@ -14,7 +15,7 @@ $(BUILD_DIR)/%.o: %.cpp | $(BUILD_DIR)
|
||||||
$(CXX) -c $(CXXFLAGS) $< -o $@
|
$(CXX) -c $(CXXFLAGS) $< -o $@
|
||||||
|
|
||||||
wibo: $(O_FILES)
|
wibo: $(O_FILES)
|
||||||
$(CXX) $(CXXFLAGS) $^ -o $@
|
$(CXX) $(CXXFLAGS) $^ -o $@ $(LDFLAGS)
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
$(RM) -r $(BUILD_DIR) wibo
|
$(RM) -r $(BUILD_DIR) wibo
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "files.h"
|
#include "files.h"
|
||||||
|
#include <algorithm>
|
||||||
|
|
||||||
namespace files {
|
namespace files {
|
||||||
static FILE *handleFps[0x10000];
|
static FILE *handleFps[0x10000];
|
||||||
|
@ -14,7 +15,7 @@ namespace files {
|
||||||
std::replace(str.begin(), str.end(), '\\', '/');
|
std::replace(str.begin(), str.end(), '\\', '/');
|
||||||
|
|
||||||
// Remove the drive letter
|
// 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);
|
str.erase(0, 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue