Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • G GLib
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 862
    • Issues 862
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 40
    • Merge requests 40
  • 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
  • !1468

glib-compile-resources: Fix exporting on Visual Studio

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Chun-wei Fan requested to merge fix-gresource-export-msvc into master Apr 30, 2020
  • Overview 17
  • Commits 1
  • Pipelines 4
  • Changes 1

Hi,

When trying to add Visual Studio build support for libpeas, I have come into a problem where the symbols that are in the generated GResource C sources are not really exported although it is requested that they are exported, because we only have an extern annotation in the generated sources, which is not enough for Visual Studio-style compilers to export such symbols.

So, this attempts to fix this by putting the prefix:

#if defined (G_OS_WIN32) && defined (_MSC_VER)
__declspec(dllexport)
#endif

before the extern in the generated functions in the generated C sources (not headers, as they are not really included by the generated C sources), unless we are using the --internal option.

Since this only affects individual generated sources, I think we do not need to define macros for this.

This MR will apply to both master and glib-2-64 and earlier.

With blessings, thank you!

Fixes: #1215 (closed)

Edited May 11, 2020 by Philip Withnall
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: fix-gresource-export-msvc