diff --git a/config.h.meson b/config.h.meson index 9be790187..ac0b5e0b7 100644 --- a/config.h.meson +++ b/config.h.meson @@ -768,7 +768,7 @@ /* Define for large files, on AIX-style hosts. */ #mesondefine _LARGE_FILES -/* Target the Windows XP API */ +/* Target the Windows 7 API */ #mesondefine _WIN32_WINNT /* Needed to get declarations for msg_control and msg_controllen on Solaris */ diff --git a/gio/meson.build b/gio/meson.build index 8f6ed1bbd..eae9bada8 100644 --- a/gio/meson.build +++ b/gio/meson.build @@ -369,7 +369,7 @@ if host_system == 'windows' contenttype_sources += ['gcontenttype-win32.c'] platform_deps += [cc.find_library('shlwapi'), cc.find_library('dnsapi'), - cc.find_library('iphlpapi'), + iphlpapi_dep, winsock2] win32_sources += [ 'gwin32registrykey.c', diff --git a/meson.build b/meson.build index 3cd2fbe1b..f29af7ebc 100644 --- a/meson.build +++ b/meson.build @@ -255,6 +255,11 @@ foreach m : struct_members endif endforeach +# Windows Support (Vista+) +if host_system == 'windows' + glib_conf.set('_WIN32_WINNT', '0x0601') +endif + functions = [ 'alloca', 'mmap', @@ -311,8 +316,6 @@ functions = [ 'kqueue', 'kevent', 'endservent', - 'if_indextoname', - 'if_nametoindex', 'sendmmsg', 'recvmmsg', ] @@ -328,6 +331,25 @@ else have_func_statfs = false endif +if host_system == 'windows' + iphlpapi_dep = cc.find_library('iphlpapi') + iphlpapi_funcs = ['if_nametoindex', 'if_indextoname'] + foreach ifunc : iphlpapi_funcs + if cc.has_function(ifunc, + prefix : '#define _WIN32_WINNT 0x0601\n#include \n#include ', + dependencies : iphlpapi_dep) + idefine = 'HAVE_' + ifunc.underscorify().to_upper() + glib_conf.set(idefine, 1) + glib_conf_prefix = glib_conf_prefix + '#define @0@ 1\n'.format(idefine) + set_variable('have_func_' + ifunc, true) + else + set_variable('have_func_' + ifunc, false) + endif + endforeach +else + functions += ['if_indextoname', 'if_nametoindex'] +endif + # AIX splice is something else if host_system != 'aix' functions += ['splice'] @@ -674,6 +696,7 @@ endif # AC_FUNC_PRINTF_UNIX98 # Nothing uses HAVE_UNIX98_PRINTF + # Check for nl_langinfo and CODESET # FIXME: Check for HAVE_BIND_TEXTDOMAIN_CODESET if cc.links('''#include