broker: properly check for getaddrinfo_a()

getaddrinfo_a( is protected by _GNU_SOURCE.

This is properly accounted for in the source code, in lib/net_mosq.c,
but the check in the CmakeList is missing that define, which causes
the check to actually fail.

Add that define when checking; this fixes builds on various C libraries,
like uClibc-ng, musl, or newer/older glibc.

Signed-off-by: Yann E. MORIN <yann.morin@orange.com>
This commit is contained in:
Yann E. MORIN
2026-02-10 09:21:11 +01:00
committed by Roger A. Light
parent 68b939f997
commit 8c3bc32689

View File

@@ -184,6 +184,7 @@ endif()
if(WITH_ADNS)
cmake_push_check_state()
set(ANL_CODE "
#define _GNU_SOURCE
#include <stdlib.h>
#include <netdb.h>
int main(){