From 31be0476a4e9944b13f5e84e7b2c789d04832cb0 Mon Sep 17 00:00:00 2001 From: Owen Taylor Date: Sat, 17 Nov 2001 23:22:43 +0000 Subject: [PATCH] Exit with non-zero exit status if any errors were encountered. Sat Nov 17 18:14:40 2001 Owen Taylor * glib-genmarshal.c: Exit with non-zero exit status if any errors were encountered. * glib-genmarshal.c: Instead of generating gobject/gmarshal.h #include only for the header, generate glib-object.h #include for both the header and body. (#63834) * glib-genmarshal.c: Generate include guards around the content unless --nostdinc is specified. --- gobject/ChangeLog | 12 ++++++++++++ gobject/glib-genmarshal.c | 22 +++++++++++++++++----- 2 files changed, 29 insertions(+), 5 deletions(-) diff --git a/gobject/ChangeLog b/gobject/ChangeLog index e6471785..092978fe 100644 --- a/gobject/ChangeLog +++ b/gobject/ChangeLog @@ -1,3 +1,15 @@ +Sat Nov 17 18:14:40 2001 Owen Taylor + + * glib-genmarshal.c: Exit with non-zero exit status if + any errors were encountered. + + * glib-genmarshal.c: Instead of generating gobject/gmarshal.h + #include only for the header, generate glib-object.h + #include for both the header and body. (#63834) + + * glib-genmarshal.c: Generate include guards around the + content unless --nostdinc is specified. + 2001-11-17 Tor Lillqvist * gobject.def: Add g_pointer_type_register_static. diff --git a/gobject/glib-genmarshal.c b/gobject/glib-genmarshal.c index aad4b5c5..31ee18c9 100644 --- a/gobject/glib-genmarshal.c +++ b/gobject/glib-genmarshal.c @@ -568,6 +568,7 @@ main (int argc, GScanner *scanner; GSList *slist, *files = NULL; gint i; + gint result = 0; /* parse args and do fast exits */ parse_args (&argc, &argv); @@ -596,13 +597,19 @@ main (int argc, /* put out initial heading */ fprintf (fout, "\n"); - if (gen_cheader) + + if (gen_cheader && std_includes) { - if (std_includes) - fprintf (fout, "#include\t\n\n"); - fprintf (fout, "G_BEGIN_DECLS\n"); + fprintf (fout, "#ifndef __%s_MARSHAL_H__\n", marshaller_prefix); + fprintf (fout, "#define __%s_MARSHAL_H__\n\n", marshaller_prefix); } + if ((gen_cheader || gen_cbody) && std_includes) + fprintf (fout, "#include\t\n\n"); + + if (gen_cheader) + fprintf (fout, "G_BEGIN_DECLS\n"); + /* process input files */ for (slist = files; slist; slist = slist->next) { @@ -612,6 +619,7 @@ main (int argc, if (fd < 0) { g_warning ("failed to open \"%s\": %s", file, g_strerror (errno)); + result = 1; continue; } @@ -670,6 +678,7 @@ main (int argc, if (expected_token != G_TOKEN_NONE) { g_scanner_unexp_token (scanner, expected_token, "type name", NULL, NULL, NULL, TRUE); + result = 1; break; } @@ -684,6 +693,9 @@ main (int argc, if (gen_cheader) { fprintf (fout, "\nG_END_DECLS\n"); + + if (std_includes) + fprintf (fout, "\n#endif /* __%s_MARSHAL_H__ */\n", marshaller_prefix); } fprintf (fout, "\n"); @@ -693,7 +705,7 @@ main (int argc, g_hash_table_foreach_remove (marshallers, string_key_destroy, NULL); g_hash_table_destroy (marshallers); - return 0; + return result; } static void -- 2.34.1