diff --git a/ChangeLog b/ChangeLog index 8901d8a1e1..d64d48013a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2007-01-16 Tim-Philipp Müller + + * libs/gst/check/gstcheck.c: (gst_check_abi_list): + Actually write ABI structs to the file specified in the GST_ABI + environment variable, as the message we print claims we would. + 2007-01-15 Stefan Kost * tests/check/gst/gsttask.c: diff --git a/libs/gst/check/gstcheck.c b/libs/gst/check/gstcheck.c index bdef23db33..85fab69216 100644 --- a/libs/gst/check/gstcheck.c +++ b/libs/gst/check/gstcheck.c @@ -280,16 +280,27 @@ gst_check_abi_list (GstCheckABIStruct list[], gboolean have_abi_sizes) } fail_unless (ok, "failed ABI check"); } else { - if (g_getenv ("GST_ABI")) { + const gchar *fn; + + if ((fn = g_getenv ("GST_ABI"))) { + GError *err = NULL; + GString *s; gint i; - g_print ("\nGstCheckABIStruct list[] = {\n"); + s = g_string_new ("\nGstCheckABIStruct list[] = {\n"); for (i = 0; list[i].name; i++) { - g_print (" {\"%s\", sizeof (%s), %d},\n", list[i].name, list[i].name, - list[i].size); + g_string_append_printf (s, " {\"%s\", sizeof (%s), %d},\n", + list[i].name, list[i].name, list[i].size); } - g_print (" {NULL, 0, 0}\n"); - g_print ("};\n"); + g_string_append (s, " {NULL, 0, 0}\n"); + g_string_append (s, "};\n"); + if (!g_file_set_contents (fn, s->str, s->len, &err)) { + g_print ("%s", s->str); + g_printerr ("\nFailed to write ABI information: %s\n", err->message); + } else { + g_print ("\nWrote ABI information to '%s'.\n", fn); + } + g_string_free (s, TRUE); } else { g_print ("No structure size list was generated for this architecture.\n"); g_print ("Run with GST_ABI environment variable set to output header.\n");