diff options
| author | Mosder <git@mosder.eu> | 2026-10-20 14:44:33 +0200 |
|---|---|---|
| committer | Mosder <git@mosder.eu> | 2026-10-20 14:44:33 +0200 |
| commit | fc5f5f1f58542500734841822768267d0ece2456 (patch) | |
| tree | 0501e3d718338094f58f5e6af1232ee4900372b2 /Makefile | |
| parent | ec315985c9f51c932b1177539c43a024bf58207d (diff) | |
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
Diffstat (limited to 'Makefile')
| -rw-r--r-- | Makefile | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -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 <stdio.h>\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 |
