After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 796220 - meson: do not run atomic test with msvc
meson: do not run atomic test with msvc
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: build
unspecified
Other All
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2018-05-17 20:25 UTC by Mathieu Duponchelle
Modified: 2018-05-22 08:49 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
meson: do not run atomic test with msvc (1.09 KB, patch)
2018-05-17 20:25 UTC, Mathieu Duponchelle
none Details | Review
meson: do not run atomic test with msvc (1.09 KB, patch)
2018-05-21 14:13 UTC, Mathieu Duponchelle
none Details | Review
meson: do not run atomic test with msvc (1.17 KB, patch)
2018-05-21 14:47 UTC, Mathieu Duponchelle
committed Details | Review

Description Mathieu Duponchelle 2018-05-17 20:25:48 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
Comment 1 Mathieu Duponchelle 2018-05-17 20:25:53 UTC
Created attachment 372161 [details] [review]
meson: do not run atomic test with msvc
Comment 2 Philip Withnall 2018-05-18 10:24:37 UTC
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.
Comment 3 Mathieu Duponchelle 2018-05-21 14:13:46 UTC
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
Comment 4 Mathieu Duponchelle 2018-05-21 14:14:44 UTC
I added a simple comment specifically about the MSVC case, I think that's enough for that particular patch.
Comment 5 Mathieu Duponchelle 2018-05-21 14:47:37 UTC
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
Comment 6 Philip Withnall 2018-05-22 08:47:44 UTC
Review of attachment 372296 [details] [review]:

I think this still needs the full comment, but I’ll just add it when I push.
Comment 7 Philip Withnall 2018-05-22 08:49:45 UTC
Attachment 372296 [details] pushed as 3c9a7ec - meson: do not run atomic test with msvc