gotk4
gotk4 copied to clipboard
Override C function headers with untyped variant
I've thought of a way that can potentially improve compile time significantly.
Many C types don't actually have to be resolved by Cgo, since they're only handled around as pointers. As a result, something like
void gtk_text_buffer_insert(GtkTextBuffer* buffer, GtkTextIter* iter, const char* text, int len);
can instead be
void gtk_text_buffer_insert(void* buffer, void* iter, const char* text, int len);
Doing so to all classes will have already gone a long way. Additional heuristics can be implemented to detect whether or not we'll generate code that accesses a field as well.
This may involve slight refactoring of package types to add an additional
piece of information regarding the CType.