GNOME Bugzilla – Bug 648973
Add --disable-typedef to valac
Last modified: 2018-05-22 14:02:01 UTC
Created attachment 186899 [details] [review] 0001-valac-Add-disable-typedef.patch To support gtype instance struct types on the form typedef struct _SomeClass SomeClass; to be declared in a file other than the C header file for a class, add a --disable-typedef option to valac. Things still don't quite work as I want, but it would be nice to get a "we're never going to accept this patch" or a "we'll probably include that patch when you've fixed all important problems with it".
It would help if you explained why or in what situation you'd like to use this. I can understand that C libraries may want a separate -types.h file with all the typedefs in addition to the per-class header files to, e.g., avoid header cycles. However, as Vala generates a single header file for the whole library, I don't really see the point in such a separate typedef header file.
My particular use case is to use Vala for core GIMP classes, which currently is pure GObject C. For example, I'd like to be able to use Vala to generate http://git.gnome.org/browse/gimp/tree/app/core/gimptag.h, which has the instance struct typedeffed in http://git.gnome.org/browse/gimp/tree/app/core/core-types.h#n164
Created attachment 186965 [details] [review] 0001-valac-Add-disable-typedef.patch Only apply the new option to header files. This patch doesn't to me have any known problems.
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/vala/issues/197.