GNOME Bugzilla – Bug 796220
meson: do not run atomic test with msvc
Last modified: 2018-05-22 08:49:49 UTC
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
Created attachment 372161 [details] [review] meson: do not run atomic test with msvc
Review of attachment 372161 [details] [review]: These checks are getting to the stage where they need some documentation. There’s a lovely comment around line 2300 in configure.ac (“We need to decide at configure time…”) which could be copied into meson.build and adapted. Otherwise it’s not at all obvious why MSVC gets special treatment for the G_ATOMIC_LOCK_FREE checks.
Created attachment 372292 [details] [review] 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
I added a simple comment specifically about the MSVC case, I think that's enough for that particular patch.
Created attachment 372296 [details] [review] 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
Review of attachment 372296 [details] [review]: I think this still needs the full comment, but I’ll just add it when I push.
Attachment 372296 [details] pushed as 3c9a7ec - meson: do not run atomic test with msvc