]> The Tcpdump Group git mirrors - libpcap/commitdiff
Define _GNU_SOURCE on most platforms.
authorGuy Harris <[email protected]>
Sat, 25 Apr 2020 23:17:13 +0000 (16:17 -0700)
committerGuy Harris <[email protected]>
Sat, 25 Apr 2020 23:17:13 +0000 (16:17 -0700)
Don't assume only Linux and Cygwin are using GNU libc; GNU/HURD and
Debian's kFreeBSD do.

ftmacros.h

index bb08a11a2b871a11768d113d239013fefd345245..3fafab8059435afc050e6d1489e918217ed1d3bb 100644 (file)
    * 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