libs/gst/check/gstcheck.c: Actually write ABI structs to the file specified in the GST_ABI environment variable, as t...

Original commit message from CVS:
* 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.
This commit is contained in:
Tim-Philipp Müller 2007-01-16 09:57:50 +00:00
parent 5826d1676c
commit e94feebf11
2 changed files with 23 additions and 6 deletions

View file

@ -1,3 +1,9 @@
2007-01-16 Tim-Philipp Müller <tim at centricular dot net>
* 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 <ensonic@users.sf.net> 2007-01-15 Stefan Kost <ensonic@users.sf.net>
* tests/check/gst/gsttask.c: * tests/check/gst/gsttask.c:

View file

@ -280,16 +280,27 @@ gst_check_abi_list (GstCheckABIStruct list[], gboolean have_abi_sizes)
} }
fail_unless (ok, "failed ABI check"); fail_unless (ok, "failed ABI check");
} else { } else {
if (g_getenv ("GST_ABI")) { const gchar *fn;
if ((fn = g_getenv ("GST_ABI"))) {
GError *err = NULL;
GString *s;
gint i; gint i;
g_print ("\nGstCheckABIStruct list[] = {\n"); s = g_string_new ("\nGstCheckABIStruct list[] = {\n");
for (i = 0; list[i].name; i++) { for (i = 0; list[i].name; i++) {
g_print (" {\"%s\", sizeof (%s), %d},\n", list[i].name, list[i].name, g_string_append_printf (s, " {\"%s\", sizeof (%s), %d},\n",
list[i].size); list[i].name, list[i].name, list[i].size);
} }
g_print (" {NULL, 0, 0}\n"); g_string_append (s, " {NULL, 0, 0}\n");
g_print ("};\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 { } else {
g_print ("No structure size list was generated for this architecture.\n"); 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"); g_print ("Run with GST_ABI environment variable set to output header.\n");