fix(build): include <fcntl.h> for the Windows lock flags
graph.c's lock_try_once() opens the lock file with _open(path, _O_CREAT|_O_EXCL|_O_WRONLY|_O_BINARY, ...). Those four constants live in <fcntl.h>, not <io.h>, and the _WIN32 branch pulled in only <io.h>. glibc builds never noticed because the POSIX branch includes <fcntl.h> anyway, so the defect was invisible until the MinGW cross build - the windows-x86_64 dist target - failed with "_O_CREAT undeclared ... did you mean WM_CREATE?".
AuthorPico <picobot@scorpioplayer.com>
Date2026-11-13 22:58:11
Commit6ab4f3dc
Parents97832b99
Changed files
src/graph.c+1−0■
1 file+1−0
Diff
src/graph.c+1−0■
index 3e4e898..ab1390f 100644
--- a/src/graph.c
+++ b/src/graph.c
@@ -47,6 +47,7 @@
4747 # include <windows.h>
4848 # include <direct.h>
4949 # include <io.h>
50+# include <fcntl.h> /* _O_CREAT/_O_EXCL/_O_WRONLY/_O_BINARY on MinGW */
5051 # include <sys/stat.h>
5152 # include <sys/types.h>
5253 #else
5354
src/graph.c+1−0■
index 3e4e898..ab1390f 100644index 3e4e898..ab1390f 100644
--- a/src/graph.c--- a/src/graph.c
+++ b/src/graph.c+++ b/src/graph.c
@@ -47,6 +47,7 @@@@ -47,6 +47,7 @@
47 # include <windows.h>47 # include <windows.h>
48 # include <direct.h>48 # include <direct.h>
49 # include <io.h>49 # include <io.h>
50+# include <fcntl.h> /* _O_CREAT/_O_EXCL/_O_WRONLY/_O_BINARY on MinGW */
50 # include <sys/stat.h>51 # include <sys/stat.h>
51 # include <sys/types.h>52 # include <sys/types.h>
52 #else53 #else
5354