The fuzz test http_request
calls the following two internal libevent functions:
evhttp_parse_firstline_
evhttp_parse_headers_
Before libevent 2.1.1 however, internal functions names didn’t end with an underscore (see libevent commit https://github.com/libevent/libevent/commit/8ac3c4c25bea4b9948ab91cd00605bf34fc0bd72 and Changelog for 2.1.1.-alpha when the change was first mentioned) hence the build fails with a linking error.
This PR adds a preprocessor workaround to the test that checks for the libevent version (via ~_EVENT_NUMERIC_VERSION
~ LIBEVENT_VERSION_NUMBER
) and creates wrapper functions mapping to naming scheme without underscore in case the version is older than 2.1.1.
Tested with Ubuntu Xenial 16.04.6 LTS and clang-8.