summaryrefslogtreecommitdiff
path: root/gobject/glib-genmarshal.c
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@redhat.com>2001-11-17 23:22:43 +0000
committerOwen Taylor <otaylor@src.gnome.org>2001-11-17 23:22:43 +0000
commit31be0476a4e9944b13f5e84e7b2c789d04832cb0 (patch)
tree049755d3c1203d844cfd362e9f7de72a9589e37e /gobject/glib-genmarshal.c
parent1457aaedd86951550a0709726b6e9a5d33a34167 (diff)
Exit with non-zero exit status if any errors were encountered.
Sat Nov 17 18:14:40 2001 Owen Taylor <otaylor@redhat.com> * 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.
Diffstat (limited to 'gobject/glib-genmarshal.c')
-rw-r--r--gobject/glib-genmarshal.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/gobject/glib-genmarshal.c b/gobject/glib-genmarshal.c
index aad4b5c59..31ee18c95 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<gobject/gmarshal.h>\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<glib-object.h>\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