Tue Jan 30 00:12:48 2024 UTC (139d)
libxml2: restrict _POSIX_C_SOURCE to Linux

Fix build breakage with FreeBSD, where some definitions were then hidden
by __BSD_VISIBLE not being defined, e.g.:

  CC       libxml2_la-nanohttp.lo
nanohttp.c:837:20: error: use of undeclared identifier 'PF_INET6'
        s = socket(PF_INET6, SOCK_STREAM, IPPROTO_TCP);
                   ^
nanohttp.c:842:20: error: use of undeclared identifier 'PF_INET'
        s = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP);
                   ^
2 errors generated.

(Tested on FreeBSD 14 and Fedora Linux 39.)


(gutteridge)
diff -r1.178 -r1.179 pkgsrc/textproc/libxml2/Makefile

cvs diff -r1.178 -r1.179 pkgsrc/textproc/libxml2/Makefile (expand / switch to context diff)
--- pkgsrc/textproc/libxml2/Makefile 2024/01/27 21:07:16 1.178
+++ pkgsrc/textproc/libxml2/Makefile 2024/01/30 00:12:48 1.179
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.178 2024/01/27 21:07:16 sjmulder Exp $
+# $NetBSD: Makefile,v 1.179 2024/01/30 00:12:48 gutteridge Exp $
 
 .include "../../textproc/libxml2/Makefile.common"
 
@@ -23,7 +23,7 @@
 FORCE_C_STD=		c99
 
 # for struct addrinfo on glibc
-CPPFLAGS+=	-D_POSIX_C_SOURCE=200112L  
+CPPFLAGS.Linux+=	-D_POSIX_C_SOURCE=200112L  
 
 TEST_TARGET=	check