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.
This commit is contained in:
Owen Taylor 2001-11-17 23:22:43 +00:00 committed by Owen Taylor
parent 1457aaedd8
commit 31be0476a4
2 changed files with 29 additions and 5 deletions

View File

@ -1,3 +1,15 @@
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> 2001-11-17 Tor Lillqvist <tml@iki.fi>
* gobject.def: Add g_pointer_type_register_static. * gobject.def: Add g_pointer_type_register_static.

View File

@ -568,6 +568,7 @@ main (int argc,
GScanner *scanner; GScanner *scanner;
GSList *slist, *files = NULL; GSList *slist, *files = NULL;
gint i; gint i;
gint result = 0;
/* parse args and do fast exits */ /* parse args and do fast exits */
parse_args (&argc, &argv); parse_args (&argc, &argv);
@ -596,13 +597,19 @@ main (int argc,
/* put out initial heading */ /* put out initial heading */
fprintf (fout, "\n"); fprintf (fout, "\n");
if (gen_cheader)
if (gen_cheader && std_includes)
{ {
if (std_includes) fprintf (fout, "#ifndef __%s_MARSHAL_H__\n", marshaller_prefix);
fprintf (fout, "#include\t<gobject/gmarshal.h>\n\n"); fprintf (fout, "#define __%s_MARSHAL_H__\n\n", marshaller_prefix);
fprintf (fout, "G_BEGIN_DECLS\n");
} }
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 */ /* process input files */
for (slist = files; slist; slist = slist->next) for (slist = files; slist; slist = slist->next)
{ {
@ -612,6 +619,7 @@ main (int argc,
if (fd < 0) if (fd < 0)
{ {
g_warning ("failed to open \"%s\": %s", file, g_strerror (errno)); g_warning ("failed to open \"%s\": %s", file, g_strerror (errno));
result = 1;
continue; continue;
} }
@ -670,6 +678,7 @@ main (int argc,
if (expected_token != G_TOKEN_NONE) if (expected_token != G_TOKEN_NONE)
{ {
g_scanner_unexp_token (scanner, expected_token, "type name", NULL, NULL, NULL, TRUE); g_scanner_unexp_token (scanner, expected_token, "type name", NULL, NULL, NULL, TRUE);
result = 1;
break; break;
} }
@ -684,6 +693,9 @@ main (int argc,
if (gen_cheader) if (gen_cheader)
{ {
fprintf (fout, "\nG_END_DECLS\n"); fprintf (fout, "\nG_END_DECLS\n");
if (std_includes)
fprintf (fout, "\n#endif /* __%s_MARSHAL_H__ */\n", marshaller_prefix);
} }
fprintf (fout, "\n"); fprintf (fout, "\n");
@ -693,7 +705,7 @@ main (int argc,
g_hash_table_foreach_remove (marshallers, string_key_destroy, NULL); g_hash_table_foreach_remove (marshallers, string_key_destroy, NULL);
g_hash_table_destroy (marshallers); g_hash_table_destroy (marshallers);
return 0; return result;
} }
static void static void