From: Guy Harris Date: Sat, 25 Apr 2020 23:17:13 +0000 (-0700) Subject: Define _GNU_SOURCE on most platforms. X-Git-Tag: libpcap-1.10-bp~208 X-Git-Url: https://git.tcpdump.org/libpcap/commitdiff_plain/20348670d5f3f8746d85a9892aa312e7591da4de Define _GNU_SOURCE on most platforms. Don't assume only Linux and Cygwin are using GNU libc; GNU/HURD and Debian's kFreeBSD do. --- diff --git a/ftmacros.h b/ftmacros.h index bb08a11a..3fafab80 100644 --- a/ftmacros.h +++ b/ftmacros.h @@ -83,14 +83,18 @@ * least with HP's C compiler; hopefully doing so won't make it * *not* work with *un*-threaded code. */ -#elif defined(__linux__) || defined(linux) || defined(__linux) || defined(__CYGWIN__) +#else /* * Turn on _GNU_SOURCE to get everything GNU libc has to offer, - * including asprintf(). + * including asprintf(), if we're using GNU libc. * * Unfortunately, one thing it has to offer is a strerror_r() * that's not POSIX-compliant, but we deal with that in * pcap_fmt_errmsg_for_errno(). + * + * We don't limit this to, for example, Linux and Cygwin, because + * this might, for example, be GNU/HURD or one of Debian's kFreeBSD + * OSes ("GNU/FreeBSD"). */ #define _GNU_SOURCE