Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
P
poppler
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 614
    • Issues 614
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 40
    • Merge Requests 40
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • CI / CD
    • Repository
    • Value Stream
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • poppler
  • poppler
  • Issues
  • #370

Closed
Open
Opened Aug 17, 2018 by Bugzilla Migration User@bugzilla-migration

allow using gfile.h with glib

Submitted by Christian Persch (GNOME)

Assigned to poppler-bugs

Link to original bug (#107608)

Description

Created attachment 141172 proposed patch

(Moved to a separate bug as per bug 107599 comment 1.)

In bug 107599 I have a need to include goo/gfile.h in poppler/glib/poppler-document.cc together with <glib.h> However doing so leads to a compile error, since goo/gfile.h defines a "GDir" class which ufortunately is also the name of a glib type[https://gitlab.gnome.org/GNOME/glib/tree/master/glib/gdir.h]:

..../include/glib-2.0/glib/gdir.h:37:22: Fehler: conflicting declaration »typedef struct _GDir GDir« typedef struct _GDir GDir; ^~~~ ..../poppler/poppler/goo/gfile.h:199:7: Anmerkung: previous declaration as »class GDir« class GDir { ^~~~

[From bug 107599 comment 1]:

I'm really not happy when we get workarounds in our code because we collide with other repos type names, why should we be the ones adding workarounds and not the other codes?

I don't see a way to suppress glib's GDir. <glib.h> includes gdir.h and glib-autocleanups.h. The gdir.h file's contents is guarded by #ifndef G_DIR_H which we could pre-define to skip its contents, but the <glib.h> also includes <glib-autocleanups.h> which requires gdir.h and has itself no such guard. Also these include guard names are not part of the glib API, they are internal and we cannot rely on them.

OTOH poppler controls its own names, so if we work around this inside poppler, we can rely on it.

The attached patch enables this by omitting the GDir (and GDirEntry) classes from goo/gfile.h when GFILE_NO_GDIR is #define'd.

Attachment 141172, "proposed patch":
p

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: poppler/poppler#370