Commit: 9edc6ee7e1c1f6d74063db4a5b2268dc7d19cccc
Parent: eba3307fd35d076d2eb1989431abbd17e8b11fcb
Author: Randy Palamar
Date: Thu, 24 Oct 2024 06:31:29 -0600
don't link test to GLFW
Diffstat:
2 files changed, 19 insertions(+), 7 deletions(-)
diff --git a/build.sh b/build.sh
@@ -9,7 +9,9 @@ cflags="-march=native -O3 -Wall -DVERSION=\"${version}\""
#cflags="${cflags} -Rpass-missed=.*"
ldflags="-lm -lGL -lglfw"
-testcflags="$cflags -O0 -ggdb -D_DEBUG -Wno-unused-variable -Wno-unused-function -Wno-undefined-internal"
+testcflags="${cflags} -O0 -ggdb -D_DEBUG -UVERSION -DVERSION=test"
+testcflags="${testcflags} -Wno-unused-variable -Wno-unused-function -Wno-undefined-internal"
+testcflags="${testcflags} -lm -static"
[ ! -s "./config.h" ] && cp config.def.h config.h
@@ -25,4 +27,4 @@ if [ ${debug} ] && [ ${debug} != "0" ]; then
fi
${cc} $cflags -o vtgl main.c $ldflags
-${cc} $testcflags -o test test.c $ldflags
+${cc} ${testcflags} -o test test.c
diff --git a/test.c b/test.c
@@ -2,16 +2,26 @@
#include <string.h> /* memcmp */
#include <wchar.h> /* wcwidth */
-#define GL_GLEXT_PROTOTYPES 1
-#include <GLFW/glfw3.h>
+#define GLFW_PRESS 1
+#define GLFW_REPEAT 2
+
+#define GLFW_MOD_SHIFT 0x0001
+#define GLFW_MOD_CONTROL 0x0002
+#define GLFW_MOD_ALT 0x0004
+
+#define GLFW_KEY_C 67
+#define GLFW_KEY_J 74
+#define GLFW_KEY_K 75
+#define GLFW_KEY_V 86
+#define GLFW_KEY_PAGE_UP 266
+#define GLFW_KEY_PAGE_DOWN 267
+
+#define GLFWwindow void
#include "util.h"
#include "config.h"
/* NOTE: stubs for stuff we aren't testing */
-#undef glfwSetWindowTitle
-#undef glfwGetWindowTitle
-
void glfwSetWindowTitle(GLFWwindow *w, const char *s) {}
const char *glfwGetWindowTitle(GLFWwindow *w) { return "test"; }