]> 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 b0e750556949761c3491ef2a97df7ebd63b6b2ab..295199cb6c0263d3d89b929f9c26b97729b37621 100644 (file)
@@ -3492,13 +3492,13 @@ open_files(void)
                if (file_sep != 0)
                        sep[0] = file_sep;
                outfilephbase = g_strconcat (fullfilebase, sep, "private.h", NULL);
-               outfileph = g_strconcat (outfilephbase, no_touch ? "#gob#" : "", NULL);
+               outfileph = g_strconcat (outfilephbase, no_touch_headers ? "#gob#" : "", NULL);
        } else {
                outfilephbase = NULL;
                outfileph = NULL;
        }
 
-       
+
        if ( ! no_write) {
                out = fopen (outfile, "w");
                if (out == NULL) {
@@ -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"
@@ -4964,15 +4967,16 @@ main(int argc, char *argv[])
        if (outph)
                fclose (outph);
 
-       if (! no_write) {
+       if (!no_write) {
                if (no_touch) {
-                       compare_and_move (outfilebase);
+                       compare_and_move(outfilebase);
+               }
+               if (no_touch_headers) {
+                       compare_and_move(outfilehbase);
                        if (outfilephbase)
-                               compare_and_move (outfilephbase);
+                               compare_and_move(outfilephbase);
                }
-               if (no_touch_headers)
-                       compare_and_move (outfilehbase);
        }
-       
+
        return 0;
 }