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
This commit is contained in:
Mathieu Duponchelle 2018-05-17 22:19:59 +02:00 committed by Philip Withnall
parent 7551267f19
commit 3c9a7ec270

View File

@ -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')