Skip to content
GitLab
Projects Groups Topics 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
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 852
    • Issues 852
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 42
    • Merge requests 42
  • 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
  • !1935

gmacros: Guard C++ code with extern "C++"

  • Review changes

  • Download
  • Patches
  • Plain diff
Closed Kalev Lember requested to merge wip/kalev/decltype-extern-Cplusplus into master Feb 08, 2021
  • Overview 11
  • Commits 1
  • Pipelines 2
  • Changes 1

A number of C++ consumers are (incorrectly) including glib headers in an extern "C" block, which leads to build failures such as:

/usr/include/c++/11/type_traits:56:3: error: template with C linkage
   56 |   template<typename _Tp, _Tp __v>
      |   ^~~~~~~~

We can easily escape that on the glib side by putting the C++ code in an extern "C++" block. Which technically it's a bug on the consuming program's side, I think it's pragmatic here to work this around on the glib side.

Edited Feb 08, 2021 by Emmanuele Bassi
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: wip/kalev/decltype-extern-Cplusplus