From fc5f5f1f58542500734841822768267d0ece2456 Mon Sep 17 00:00:00 2001 From: Mosder Date: Tue, 20 Oct 2026 14:44:33 +0200 Subject: feat: improved support for windows. added gating behind _WIN32 to use _ prefixed versions of functions and made it work (with limited functionality) on machines without fileno --- Makefile | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index ae8a59e..044e2b4 100644 --- a/Makefile +++ b/Makefile @@ -29,12 +29,18 @@ endef PROBED:= \ $(call probe_fun,string.h,memmem) \ - $(call probe_fun,string.h,strdup) \ - $(call probe_fun,stdio.h,fileno) + $(call probe_fun,string.h,strdup) CFLAGS+=$(PROBED) TESTS_CFLAGS+=$(PROBED) +FS_FLAG:=$(shell printf '#include "compat.h"\n#include \nint main(void){\n#ifdef _WIN32\n_fileno;\n#else\nfileno;\n#endif\nreturn 0;}' \ + | $(CC) $(CFLAGS) -x c - -o /dev/null 2>/dev/null \ + || echo -DNO_FS) + +CFLAGS+=$(FS_FLAG) +TESTS_CFLAGS+=$(FS_FLAG) + both: CLEANUP=true both: clean shared static @$(MAKE) clean --no-print-directory -- cgit v1.2.3