git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] compat: fixes for header handling with OpenBSD / NetBSD

From
Brad Smith <brad@comstyle.com>
Date
Jun 2, 2025, 07:29 UTC
Message-ID
<aD1SvlRypkhczxRS@humpty.home.comstyle.com>

Handle OpenBSD and NetBSD as FreeBSD / DragonFly are. OpenBSD would need _XOPEN_SOURCE to be set to 700. Its simpler to just not set _XOPEN_SOURCE.

    CC strbuf.o
strbuf.c:645:6: warning: call to undeclared function 'getdelim'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
        r = getdelim(&sb->buf, &sb->alloc, term, fp);
            ^
1 warning generated.
Signed-off-by: Brad Smith <brad@comstyle.com>
---
 compat/posix.h | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/compat/posix.h b/compat/posix.h
index f4c71f9427..61fb08b64c 100644
--- a/compat/posix.h
+++ b/compat/posix.h
@@ -60,18 +60,17 @@
 # else
 # define _XOPEN_SOURCE 500
 # endif
-#elif !defined(__APPLE__) && !defined(__FreeBSD__) && !defined(__USLC__) && \
-      !defined(_M_UNIX) && !defined(__sgi) && !defined(__DragonFly__) && \
-      !defined(__TANDEM) && !defined(__QNX__) && !defined(__MirBSD__) && \
-      !defined(__CYGWIN__)
-#define _XOPEN_SOURCE 600 /* glibc2 and AIX 5.3L need 500, OpenBSD needs 600 for S_ISLNK() */
+#elif !defined(__APPLE__) && !defined(__FreeBSD__) && !defined(__NetBSD__) && \
+      !defined(__OpenBSD__) && !defined(__DragonFly__) && !defined(__MirBSD__) && \
+      !defined(__USLC__) && !defined(_M_UNIX) && !defined(__sgi) && \
+      !defined(__TANDEM) && !defined(__QNX__) && !defined(__CYGWIN__)
+#define _XOPEN_SOURCE 600 /* glibc2 and AIX 5.3L need 500 */
 #define _XOPEN_SOURCE_EXTENDED 1 /* AIX 5.3L needs this */
 #endif
 #define _ALL_SOURCE 1
 #define _GNU_SOURCE 1
 #define _BSD_SOURCE 1
 #define _DEFAULT_SOURCE 1
-#define _NETBSD_SOURCE 1
 #define _SGI_SOURCE 1
 
 #if defined(WIN32) && !defined(__CYGWIN__) /* Both MinGW and MSVC */
-- 
2.49.0
Next: Collin Funk
Message 1 of 6 in “compat: fixes for header handling with OpenBSD / NetBSD”
  1. compat: fixes for header handling with OpenBSD / NetBSDBrad Smith, Jun 2, 2025
  2. Collin FunkJun 2, 2025
  3. Junio C HamanoJun 3, 2025
  4. Brad SmithJun 3, 2025
  5. Collin FunkJun 3, 2025
  6. Junio C HamanoJun 3, 2025

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.