X-Git-Url: https://git.draconx.ca/gitweb/gob-dx.git/blobdiff_plain/77fd2f2194af12f95959506910f3babe842c5f1f..714b58ab4606ed4d40cec3702cb378938f8c883f:/src/main.c diff --git a/src/main.c b/src/main.c index 6b233d7..d94361a 100644 --- a/src/main.c +++ b/src/main.c @@ -67,6 +67,7 @@ static int privates = 0; /* number of private data members */ static int protecteds = 0; /* number of protected methods */ static int destructors = 0; /* number of variable destructors */ static int initializers = 0; /* number of variable initializers */ +static gboolean overrode_get_type = FALSE; /* provided your won _get_type */ static gboolean made_aliases = FALSE; /* if we made any shorthand aliases and need the REALLY UGLY HACK to @@ -818,8 +819,8 @@ add_get_type(void) "GtkType\n" "%s_get_type (void)\n" "{\n" - "\tstatic guint type = 0;\n\n" - "\tif ( ! type) {\n" + "\tstatic GtkType type = 0;\n\n" + "\tif (type == 0) {\n" "\t\tstatic const GtkTypeInfo info = {\n" "\t\t\t\"%s\",\n" "\t\t\tsizeof (%s),\n" @@ -2358,7 +2359,8 @@ print_class_block(Class *c) add_enums(c); - add_get_type(); + if ( ! overrode_get_type) + add_get_type(); if(any_method_to_alias(c)) { if( ! no_gnu) { @@ -2773,6 +2775,7 @@ main(int argc, char *argv[]) protecteds = count_protecteds((Class *)class); destructors = count_destructors((Class *)class); initializers = count_initializers((Class *)class); + overrode_get_type = find_get_type((Class *)class); make_bases(); make_inits((Class *)class);