I am trying to check whether symbol getaddrinfo_a exists using CMake:
list(APPEND CMAKE_REQUIRED_DEFINITIONS -D_GNU_SOURCE)
check_symbol_exists(getaddrinfo_a netdb.h HAVE_GETADDRINFO_A)
list(REMOVE_ITEM CMAKE_REQUIRED_DEFINITIONS -D_GNU_SOURCE)
While getaddrinfo_a is defined in netdb.h (given that _GNU_SOURCE is defined), CMake fails to find it:
-- Looking for getaddrinfo_a
-- Looking for getaddrinfo_a - not found.
Any idea what am I doing wrong?