]> git.proxmox.com Git - mirror_qemu.git/blobdiff - meson.build
sysemu/os-win32: Test for and use _lock_file/_unlock_file
[mirror_qemu.git] / meson.build
index 6ba60950c8d1c4d8b6bbcf906530156a9f3a7031..d083c6b7bf90281d8624fc7306f2000681876862 100644 (file)
@@ -2030,6 +2030,18 @@ foreach k, v: config_host
   endif
 endforeach
 
+# Older versions of MinGW do not import _lock_file and _unlock_file properly.
+# This was fixed for v6.0.0 with commit b48e3ac8969d.
+if targetos == 'windows'
+  config_host_data.set('HAVE__LOCK_FILE', cc.links('''
+    #include <stdio.h>
+    int main(void) {
+      _lock_file(NULL);
+      _unlock_file(NULL);
+      return 0;
+    }''', name: '_lock_file and _unlock_file'))
+endif
+
 ########################
 # Target configuration #
 ########################