[glib] meson: do not run atomic test with msvc
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib] meson: do not run atomic test with msvc
- Date: Tue, 22 May 2018 08:49:37 +0000 (UTC)
commit 3c9a7ec2701b8f13af8a41b0532bc3830b7f706f
Author: Mathieu Duponchelle <mathieu centricular com>
Date: Thu May 17 22:19:59 2018 +0200
meson: do not run atomic test with msvc
The latest patches have fixed the atomic check, which
uses __sync_bool_compare_and_swap , and thus fails on
MSVC.
As a result, in gatomic.c, we ended up trying to include
pthread.h, which failed.
This mimics the old behaviour a bit more closely, where
G_ATOMIC_LOCK_FREE was always defined in the win32
glibconfig.h
https://bugzilla.gnome.org/show_bug.cgi?id=796220
meson.build | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/meson.build b/meson.build
index edbb5f119..b71a217ff 100644
--- a/meson.build
+++ b/meson.build
@@ -1446,7 +1446,9 @@ atomictest = '''int main() {
return 0;
}
'''
-if cc.links(atomictest, name : 'atomic ops')
+
+# We know that we can always use real ("lock free") atomic operations with MSVC
+if cc.get_id() == 'msvc' or cc.links(atomictest, name : 'atomic ops')
glibconfig_conf.set('G_ATOMIC_LOCK_FREE', true)
else
if host_machine.cpu_family() == 'x86' and cc.links(atomictest, args : '-march=i486')
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]