From 1c12c75552ef0d28edd8b7808a7ab13a039b16ef Mon Sep 17 00:00:00 2001 From: Zack Buhman Date: Mon, 15 Dec 2025 22:03:06 -0600 Subject: [PATCH] fix 32-bit Windows XP build --- Makefile | 12 ++++++++---- include/math/transform.hpp | 3 ++- src/main.c | 2 +- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index a06dc25..8f764ab 100644 --- a/Makefile +++ b/Makefile @@ -12,20 +12,24 @@ CXXSTD += -std=gnu++14 CFLAGS += -Wall -Werror -Wfatal-errors CFLAGS += -Wno-error=unused-function -CFLAGS += -Wno-error=unused-const-variable +#CFLAGS += -Wno-error=unused-const-variable #CFLAGS += -Wno-error=unused-but-set-variable CFLAGS += -Wno-error=unused-variable +CFLAGS += -Wno-error=narrowing CFLAGS += -I$(MAKEFILE_PATH)/include CFLAGS += -I$(dir $(GLFW))../include CXXFLAGS += -fno-exceptions #CFLAGS += -DDEBUG_BUTTONS #CFLAGS += -DDEBUG_AXES -LDFLAGS += -nostdlib++ -lm -ifeq ($(shell uname),Linux) +LDFLAGS += -lm +ifneq ($(shell uname),Darwin) LDFLAGS += -static-libgcc endif +ifeq ($(shell uname),Linux) +LDFLAGS += -nostdlib++ +endif ifeq ($(OS),Windows_NT) -LDFLAGS += -Wl,--subsystem,windows -mwindows +LDFLAGS += -Wl,--subsystem,windows -mwindows #-mconsole endif ifeq ($(shell uname),Darwin) LDFLAGS += -framework Foundation -framework IOKit -framework AppKit diff --git a/include/math/transform.hpp b/include/math/transform.hpp index 34c7ed4..e85e74d 100644 --- a/include/math/transform.hpp +++ b/include/math/transform.hpp @@ -149,7 +149,8 @@ template inline constexpr T inverse_length(vec<3, T> v) { float f = dot(v, v); - return 1.0f / sqrt(f); + float sqrtf = sqrt(f); + return 1.0f / sqrtf; } template diff --git a/src/main.c b/src/main.c index d95ee2b..394a1a4 100644 --- a/src/main.c +++ b/src/main.c @@ -213,7 +213,7 @@ int main() glActiveTexture(GL_TEXTURE0); uint terminus_font = make_texture(src_font_ter_u32n_data_start, - GL_RED, + GL_RGB, 256, 256, GL_RED);