From 057ae96bf091453b0585c56a676e4148bcbafe8b Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Tue, 9 Jul 2024 21:41:09 +0200 Subject: [PATCH] configure.ac: fix location of NUT_CHECK_HEADER_IPHLPAPI call [#2516] Signed-off-by: Jim Klimov --- configure.ac | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index c1efc09c15..6afc03c33c 100644 --- a/configure.ac +++ b/configure.ac @@ -1475,11 +1475,12 @@ dnl For `nut-scanner -m auto` modes, see also: dnl https://stackoverflow.com/a/41151132/4715872 dnl https://learn.microsoft.com/en-us/windows/win32/api/iphlpapi/nf-iphlpapi-getadaptersaddresses (since ~Windows Vista) dnl https://learn.microsoft.com/en-us/windows/win32/api/iphlpapi/nf-iphlpapi-getadaptersinfo (before Windows XP; not recommended later) +dnl Must check in global context, to have it not-defined where appropriate too +NUT_CHECK_HEADER_IPHLPAPI AC_CHECK_FUNCS([getifaddrs], [], [ AS_CASE([${target_os}], [*mingw*], [ dnl Check for GetAdaptersAddresses / GetAdaptersInfo - NUT_CHECK_HEADER_IPHLPAPI AS_IF([test x"${nut_cv_header_iphlpapi_h}" = xyes], [ myIPHLPAPI_TEST_HEADERS='