Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Register
  • Sign in
  • G GLib
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 860
    • Issues 860
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 55
    • Merge requests 55
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GNOMEGNOME
  • GLib
  • Merge requests
  • !2864

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

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Damjan Jovanovic requested to merge dcodejams/glib:atomic-older-cplusplus into main Aug 22, 2022
  • Overview 4
  • Commits 6
  • Pipelines 5
  • Changes 8

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().

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: atomic-older-cplusplus