Skip to content

Conversation

mcrha
Copy link
Contributor

@mcrha mcrha commented Oct 14, 2025

The i-cal-forward-declarations.h and the respective object file both had "typedef struct _ObjName ObjName;" which is not allowed before C standard 11. Rather than depend on it, inline the glib macro without the offending typedef, allowing to have it split in a common header.

Closes #1096

The i-cal-forward-declarations.h and the respective object file
both had "typedef struct _ObjName ObjName;" which is not allowed
before C standard 11. Rather than depend on it, inline the glib
macro without the offending typedef, allowing to have it split
in a common header.

Closes libical#1096
@mcrha
Copy link
Contributor Author

mcrha commented Oct 14, 2025

This is the simplest change. I've been thinking of adding needed headers into the respective API files, then I realized there are some cross-includes, which would need to change all ObjName *obj into struct _ObjName *obj in the declarations (to use the forward declaration, because it cannot use the typedef), which in turn can cause a flood of other changes.

Maybe it would be a cleaner solution, but harder to follow, I'm afraid.

The disadvantage is that the type declarations will not follow any changes made in the glib in the G_DECLARE_DERIVABLE_TYPE() macro, but I believe there will not be any in a near future anyway.

Copy link
Member

@winterz winterz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks.
go ahead and merge this.

@mcrha
Copy link
Contributor Author

mcrha commented Oct 14, 2025

Okay.

@mcrha mcrha merged commit ec13b90 into libical:master Oct 14, 2025
4 checks passed
@mcrha mcrha added this to the 4.0 milestone Oct 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

libical-glib Fix -Wtypedef-redefinition compile error on Mac

2 participants