compat: fixes for header handling with OpenBSD / NetBSD
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> Reviewed-by: Collin Funk <collin.funk1@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Brad Smith committed
Jun 2, 2025 at 03:29 UTC
35ec1e22452fa9e56e81f53bd91ef688ad3b6624
1 file changed
+5
-5
compat/posix.h
+5
-5
@@ -60,11 +60,11 @@
60
# else
61
# define _XOPEN_SOURCE 500
62
# endif
63
-#elif !defined(__APPLE__) && !defined(__FreeBSD__) && !defined(__USLC__) && \
64
- !defined(_M_UNIX) && !defined(__sgi) && !defined(__DragonFly__) && \
65
- !defined(__TANDEM) && !defined(__QNX__) && !defined(__MirBSD__) && \
66
- !defined(__CYGWIN__)
67
-#define _XOPEN_SOURCE 600 /* glibc2 and AIX 5.3L need 500, OpenBSD needs 600 for S_ISLNK() */
63
+#elif !defined(__APPLE__) && !defined(__FreeBSD__) && !defined(__NetBSD__) && \
64
+ !defined(__OpenBSD__) && !defined(__DragonFly__) && !defined(__MirBSD__) && \
65
+ !defined(__USLC__) && !defined(_M_UNIX) && !defined(__sgi) && \
66
+ !defined(__TANDEM) && !defined(__QNX__) && !defined(__CYGWIN__)
67
+#define _XOPEN_SOURCE 600 /* glibc2 and AIX 5.3L need 500 */
68
#define _XOPEN_SOURCE_EXTENDED 1 /* AIX 5.3L needs this */
69
#endif
70
#define _ALL_SOURCE 1