]> The Tcpdump Group git mirrors - libpcap/commit
Make sure asprintf() is declared if it's present.
authorGuy Harris <[email protected]>
Tue, 19 Mar 2019 08:41:03 +0000 (01:41 -0700)
committerGuy Harris <[email protected]>
Tue, 19 Mar 2019 08:41:54 +0000 (01:41 -0700)
commit5710ec495d98d89d3a7c0722786081fee908b43e
tree2dedd8017abe008f5455e1c3b4e87e81f84af740
parentbaffaf4364f5595fa86d4a67f687ce293ef1aca3
Make sure asprintf() is declared if it's present.

GNU libc is a pain.  If you don't define _GNU_SOURCE, it doesn't declare
asprintf().  If you *do* define _GNU_SOURCE, the strerror_r() it
declares isn't POSIX-compliant.

We use asprintf() if present, so we need it to be declared; define
_GNU_SOURCE in ftmacros.h.

At configuration time, if we have strerror_r(), check whether it's
GNU-style or POSIX-style, and define different #defines for those two
cases.  Handle GNU-style strerror_r() and POSIX-style strerror_r()
differently in pcap_fmt_errmsg_for_errno().

Make sure everything that uses asprintf() includes ftmacros.h before
including stdio.h.
CMakeLists.txt
cmakeconfig.h.in
config.h.in
configure
configure.ac
fmtutils.c
ftmacros.h
pcap-new.c