diff --git a/Makefile b/Makefile index b87ecd5..1eeca1f 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ CXX = g++ -LIBS = -lstdc++fs -lSDL2 -lfmt +LIBS = -lSDL2 -lfmt CXXFLAGS = -g -std=c++2a -I $(INCLUDE) -I $(BACKUPDIR) BIN = bin SOURCE = src @@ -27,10 +27,16 @@ OBJ = \ LIST = $(addprefix $(BIN)/, $(OBJ)) VPATH = $(SOURCE) $(SOURCE)/backup +# Handle compiler version caveats +OS = $(uname -s) +ifeq ($(OS), Linux) + LIBS += -lstdc++fs +endif + # Use compiler optimizations # run `make opt=1` ifdef opt -CXXFLAGS += -Ofast + CXXFLAGS += -Ofast endif all: discovery diff --git a/include/util.inl b/include/util.inl index 1a58242..98fb154 100644 --- a/include/util.inl +++ b/include/util.inl @@ -32,7 +32,7 @@ inline u16 bitseq(u16 val) inline s8 signum(double val) { - if(std::isnan(val)) throw std::invalid_argument("Invalid argument passed to util::signum"); + if(val != val) throw std::invalid_argument("Invalid argument passed to util::signum"); else return (s8) (0. < val) - (val < 0.); } diff --git a/src/Arm7.cpp b/src/Arm7.cpp index ca9c3da..e1f334f 100644 --- a/src/Arm7.cpp +++ b/src/Arm7.cpp @@ -679,7 +679,7 @@ void Arm7::updateCPSR(u32 value, bool flags_only) log(LogLevel::Warning, "Software is changing T-Bit in CPSR!\n"); // validate CPSR wasn't given an invalid state - assert(getMode()); + assert((u8) getMode()); // if (sr.state == IRQ && registers.cpsr.i == 1) return; // irq disabled bit set // if (sr.state == FIQ && registers.cpsr.f == 1) return; // fiq disabled bit set @@ -1337,4 +1337,4 @@ void Arm7::print() { // #include "HandlerArm.cpp" // #include "HandlerThumb.cpp" -// #include "swi.cpp" \ No newline at end of file +// #include "swi.cpp" diff --git a/src/main.cpp b/src/main.cpp index af182c7..fbc50fe 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -90,7 +90,7 @@ int main(int argc, char **argv) // Click X on window running = false; break; - case SDL_KEYDOWN: [[fallthrough]] + case SDL_KEYDOWN: [[fallthrough]]; case SDL_KEYUP: // Key press event if (e.key.keysym.sym == SDLK_ESCAPE)