aboutsummaryrefslogtreecommitdiff
path: root/meson.build
diff options
context:
space:
mode:
authorRichard Henderson <richard.henderson@linaro.org>2022-04-17 11:30:06 -0700
committerRichard Henderson <richard.henderson@linaro.org>2022-04-20 10:51:11 -0700
commit6391c772d7c5928d1b2abd65486330b34c97a42b (patch)
tree8b1dea837445af2485d8128696ed23a274d033b6 /meson.build
parent7fc493f8bd5b5eccf761ec9b1caa13c872e289ec (diff)
sysemu/os-win32: Test for and use _lock_file/_unlock_file
The bug referenced in os-win32.h was fixed in mingw-w64 v6. According to repology, version 5 used by ubuntu 18, which is not yet out of support, so provide a meson link test for it. Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20220417183019.755276-27-richard.henderson@linaro.org>
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build12
1 files changed, 12 insertions, 0 deletions
diff --git a/meson.build b/meson.build
index 6ba60950c8..d083c6b7bf 100644
--- a/meson.build
+++ b/meson.build
@@ -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 #
########################