Skip to content

gatomic: fix the atomic compare_and_exchange macros on older C++ standard versions

Damjan Jovanovic requested to merge dcodejams/glib:atomic-older-cplusplus into main

The fix in ad23894c only works for __cplusplus >= 201103L, but older C++ standards are not always less strict, and still fail to compile the g_atomic_int_compare_and_exchange() and g_atomic_pointer_compare_and_exchange() macros. Apply that fix to all C++ standard versions.

Also, when using Clang and older C++ versions, the glib_typeof() macro is never defined, as the C++ definition depends on __cplusplus >= 201103L, while the C definition, which would work, depends on !defined(__cplusplus). Allow Clang to use the C macro definition for glib_typeof().

Merge request reports