1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-03-09 04:58:16 +03:00

meson: simplify IPv6 check

We only need to find AF_INET6. Also make it a feature.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
This commit is contained in:
Rosen Penev 2024-06-20 21:44:39 -07:00
parent 609c51c587
commit 34fe4b8863

View File

@ -428,31 +428,7 @@ if want_http == true
endforeach
if want_ipv6 == true
### IPV6 on Windows has been supported since Windows XP SP1 (around 2003)
### see:
### https://learn.microsoft.com/en-us/windows/win32/winsock/ipv6-support-2
### nevertheless, we check it like autotools
ipv6_src = '''
#ifdef _WIN32
#include <winsock2.h>
#else
#include <sys/socket.h>
#ifdef HAVE_NETDB_H
#include <netdb.h>
#endif
#endif
int main()
{
struct sockaddr_storage ss;
socket(AF_INET6, SOCK_STREAM, 0);
getaddrinfo(0, 0, 0, 0);
return 0;
}
'''
res = cc.compiles(ipv6_src, name: 'support for IPV6')
if res == true
config_h.set10('SUPPORT_IP6', true)
endif
config_h.set('SUPPORT_IP6', cc.has_header_symbol(netheader, 'AF_INET6', required: get_option('ipv6')))
endif
endif