]> git.draconx.ca Git - gob-dx.git/blobdiff - src/main.c
Make --no-gnu suppress get_type function attributes.
[gob-dx.git] / src / main.c
index 81b22f1452220c3b8d7eb46d137337c71776bf89..295199cb6c0263d3d89b929f9c26b97729b37621 100644 (file)
@@ -3907,7 +3907,7 @@ print_class_block(Class *c)
                    " * Public methods\n"
                    " */\n");
 
-       if (!overrode_get_type) {
+       if (!overrode_get_type && !no_gnu) {
                /*
                 * For ordinary "static" types it should be safe to mark the
                 * get_type implementation as const, since the get_type
@@ -4315,7 +4315,8 @@ print_enum (EnumDef *enode)
        g_free (str);
 
        out_printf (outh, "%s_get_type()\n", funcprefix);
-       out_printf (outh, "GType %s_get_type (void) G_GNUC_CONST;\n\n", funcprefix);
+       out_printf (outh, "GType %s_get_type (void)%s;\n\n",
+                         funcprefix, no_gnu ? "": " G_GNUC_CONST");
 
        out_printf (out,
                    "GType\n%s_get_type (void)\n"
@@ -4380,7 +4381,8 @@ print_flags (Flags *fnode)
        g_free (str);
 
        out_printf (outh, "%s_get_type()\n", funcprefix);
-       out_printf (outh, "GType %s_get_type (void) G_GNUC_CONST;\n\n", funcprefix);
+       out_printf (outh, "GType %s_get_type (void)%s;\n\n",
+                         funcprefix, no_gnu ? "" : " G_GNUC_CONST");
 
        out_printf (out,
                    "GType\n%s_get_type (void)\n"
@@ -4443,7 +4445,8 @@ print_error (Error *enode)
        g_free (str);
 
        out_printf (outh, "%s_get_type ()\n", funcprefix);
-       out_printf (outh, "GType %s_get_type (void) G_GNUC_CONST;\n\n", funcprefix);
+       out_printf (outh, "GType %s_get_type (void)%s;\n\n",
+                         funcprefix, no_gnu ? "" : " G_GNUC_CONST");
 
        out_printf (out,
                    "GType\n%s_get_type (void)\n"