Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split common.h.templ into private and public headers and "seal" the private one #62

Open
martin-ejdestig opened this issue Feb 28, 2019 · 1 comment
Labels
breaks-api WARNING! This change will break the API. Suitable for new major release.

Comments

@martin-ejdestig
Copy link
Contributor

martin-ejdestig commented Feb 28, 2019

As e.g. GLib (and GTK does). Only <glib.h> is supposed to be included and all other headers are guarded by:

#if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
#error "Only <glib.h> can be included directly."
#endif

commoh.h.templ currently contains *TypeWrap and Error if any error annotations are specified in introspection XML. *TypeWrap is not meant to be used externally (if I have understood things correctly) while Error is.

Could put *TypeWrap in common_private.h.templ and require FOO_BAR_OR_SOMETHING to be defined before it is included. Error would still stay in commoh.h.templ.

@martin-ejdestig
Copy link
Contributor Author

martin-ejdestig commented Mar 2, 2019

Could also keep everything in a single header and just have a section of commoh.h.templ wrapped in an #ifdef guard.

Would avoid adding yet another file that user has to specify when invoking generator from build systems. Also a less intrusive change.

@martin-ejdestig martin-ejdestig added the breaks-api WARNING! This change will break the API. Suitable for new major release. label Mar 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaks-api WARNING! This change will break the API. Suitable for new major release.
Projects
None yet
Development

No branches or pull requests

1 participant