From: Bruno Haible Date: Wed, 12 Mar 2025 10:52:05 +0000 (+0100) Subject: fcntl-h: Fix GNULIB_defined_O_NONBLOCK on Haiku (regr. 2025-02-16). X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=ee27e996435f0daf0f8cd960285abb5859f50a4d;p=gnulib.git 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. --- diff --git a/ChangeLog b/ChangeLog index 20b40fa74f..0d363007b7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2025-03-12 Bruno Haible + + 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 doc: Improvements for gnulib git bundle. diff --git a/lib/fcntl.in.h b/lib/fcntl.in.h index ac61c0865a..d7f551b30f 100644 --- a/lib/fcntl.in.h +++ b/lib/fcntl.in.h @@ -22,8 +22,12 @@ #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 + -> -> + In this situation, GNULIB_defined_O_NONBLOCK gets defined before the + system's definition of O_NONBLOCK is processed. */ /* Needed before . May also define off_t to a 64-bit type on native Windows. */ @@ -50,6 +54,8 @@ #ifndef _@GUARD_PREFIX@_FCNTL_H +#define _@GUARD_PREFIX@_ALREADY_INCLUDING_FCNTL_H + /* Needed before . May also define off_t to a 64-bit type on native Windows. Also defines off64_t on macOS, NetBSD, OpenBSD, MSVC, Cygwin, Haiku. */ @@ -72,6 +78,8 @@ # include #endif +#undef _@GUARD_PREFIX@_ALREADY_INCLUDING_FCNTL_H + #ifndef _@GUARD_PREFIX@_FCNTL_H #define _@GUARD_PREFIX@_FCNTL_H