+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.
+
2001-11-17 Tor Lillqvist <tml@iki.fi>
* gobject.def: Add g_pointer_type_register_static.
GScanner *scanner;
GSList *slist, *files = NULL;
gint i;
+ gint result = 0;
/* parse args and do fast exits */
parse_args (&argc, &argv);
/* 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)
{
if (fd < 0)
{
g_warning ("failed to open \"%s\": %s", file, g_strerror (errno));
+ result = 1;
continue;
}
if (expected_token != G_TOKEN_NONE)
{
g_scanner_unexp_token (scanner, expected_token, "type name", NULL, NULL, NULL, TRUE);
+ result = 1;
break;
}
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");
g_hash_table_foreach_remove (marshallers, string_key_destroy, NULL);
g_hash_table_destroy (marshallers);
- return 0;
+ return result;
}
static void