From de163fe7ee64e63d36dd581db16c776831cbead0 Mon Sep 17 00:00:00 2001 From: Mosder Date: Thu, 17 Sep 2026 12:37:01 +0200 Subject: feat: improved compatibility - removed possible duplicate names, exit tests now create a fork instead of relying on being able to overwrite exit function, made tester only output ASCII escape sequences for colour into a tty --- Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 0739c71..d47cade 100644 --- a/Makefile +++ b/Makefile @@ -22,14 +22,14 @@ TESTS_LDFLAGS=-L$(LIB_DIR) -Wl,-rpath,$(LIB_DIR) -lmoslib TESTS_SRCS:=$(shell find tests compat | grep "\.c$$") define probe_fun - $(shell printf '#define $(1)\n#include <$(2)>\nint main(void){$(3);}' \ + $(shell printf '#include "compat.h"\n#include <$(1)>\nint main(void){$(2);return 0;}' \ | $(CC) $(CFLAGS) -x c - -o /dev/null 2>/dev/null \ - || echo -DNO_$(shell echo $(3) | tr a-z A-Z)) + || echo -DNO_$(shell echo $(2) | tr a-z A-Z)) endef PROBED:= \ - $(call probe_fun,_GNU_SOURCE,string.h,memmem) \ - $(call probe_fun,_XOPEN_SOURCE 500,string.h,strdup) + $(call probe_fun,string.h,memmem) \ + $(call probe_fun,string.h,strdup) CFLAGS+=$(PROBED) TESTS_CFLAGS+=$(PROBED) -- cgit v1.2.3