]> The Tcpdump Group git mirrors - libpcap/commit
Use compiler #defines to determine how to handle some function attributes.
authorGuy Harris <[email protected]>
Sun, 19 Mar 2017 18:18:43 +0000 (11:18 -0700)
committerGuy Harris <[email protected]>
Sun, 19 Mar 2017 18:18:43 +0000 (11:18 -0700)
commitc4b0e2bd57a234f474b061db5b96950bf5a81a5d
tree584ae5d187d616fd77c61f140e260b744ceb86d9
parent4b144f965200f15d93bc673365ffb676b0b06369
Use compiler #defines to determine how to handle some function attributes.

Take the set of tests in the test programs that check compiler and
version to decide how to mark functions as printflike or as not
returning, and put them into a header.  Use that throughout the libpcap
code, rather than doing configuration-time tests that have to be
replicated in the autoconf script and CMake files.

That obviates the need to put those tests into CMakeLists.txt and means
that, if we ever make functions with those attributes available by code
outside libpcap (for example, if we ever introduce a plugin mechanism
for libpcap, to allow third-party pcap modules to be maintained
separately from libpcap), we can use those declarations (making a public
header file dependent on the results of a configure script usually
doesn't work well, for a variety of reasons).
17 files changed:
Makefile.in
aclocal.m4
cmakeconfig.h.in
config.h.in
configure
configure.ac
funcattrs.h [new file with mode: 0644]
gencode.h
portability.h
tests/can_set_rfmon_test.c
tests/capturetest.c
tests/filtertest.c
tests/findalldevstest.c
tests/opentest.c
tests/reactivatetest.c
tests/selpolltest.c
tests/valgrindtest.c