+2025-03-12 Bruno Haible <bruno@clisp.org>
+
+ fcntl-h: Fix GNULIB_defined_O_NONBLOCK on Haiku (regr. 2025-02-16).
+ * lib/fcntl.in.h (_@GUARD_PREFIX@_ALREADY_INCLUDING_FCNTL_H): New macro.
+
2025-03-12 Simon Josefsson <simon@josefsson.org>
doc: Improvements for gnulib git bundle.
#endif
@PRAGMA_COLUMNS@
-#if defined __need_system_fcntl_h
-/* Special invocation convention. */
+#if defined __need_system_fcntl_h || defined _@GUARD_PREFIX@_ALREADY_INCLUDING_FCNTL_H
+/* Special invocation convention:
+ - On Haiku we have a sequence of nested includes
+ <fcntl.h> -> <unistd.h> -> <fcntl.h>
+ In this situation, GNULIB_defined_O_NONBLOCK gets defined before the
+ system's definition of O_NONBLOCK is processed. */
/* Needed before <sys/stat.h>.
May also define off_t to a 64-bit type on native Windows. */
#ifndef _@GUARD_PREFIX@_FCNTL_H
+#define _@GUARD_PREFIX@_ALREADY_INCLUDING_FCNTL_H
+
/* Needed before <sys/stat.h>.
May also define off_t to a 64-bit type on native Windows.
Also defines off64_t on macOS, NetBSD, OpenBSD, MSVC, Cygwin, Haiku. */
# include <io.h>
#endif
+#undef _@GUARD_PREFIX@_ALREADY_INCLUDING_FCNTL_H
+
#ifndef _@GUARD_PREFIX@_FCNTL_H
#define _@GUARD_PREFIX@_FCNTL_H