From: Sebastian Dröge Date: Wed, 21 Jan 2015 17:07:09 +0000 (+0100) Subject: check: Add _fail_unless() compatibility function around _ck_assert_failed() X-Git-Tag: 1.6.1~581 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ee3db74ec4e38f838f9c4b146213cac91580e807;p=platform%2Fupstream%2Fgstreamer.git check: Add _fail_unless() compatibility function around _ck_assert_failed() We exported this in < 1.5 and it was automatically used by many macros from the header. Keep it exported for now. --- diff --git a/libs/gst/check/Makefile.am b/libs/gst/check/Makefile.am index abc3b3a..8c2a1b3 100644 --- a/libs/gst/check/Makefile.am +++ b/libs/gst/check/Makefile.am @@ -109,10 +109,14 @@ LIBGSTCHECK_EXPORTED_FUNCS = \ gst_test_clock_process_id_list \ gst_test_clock_id_list_get_latest_time +# For backwards compatibility with GStreamer < 1.5 +LIBGSTCHECK_EXPORTED_COMPAT_FUNCS = \ + _fail_unless LIBGSTCHECK_EXPORTED_SYMBOLS = \ $(LIBGSTCHECK_EXPORTED_VARS) \ - $(LIBGSTCHECK_EXPORTED_FUNCS) + $(LIBGSTCHECK_EXPORTED_FUNCS) \ + $(LIBGSTCHECK_EXPORTED_COMPAT_FUNCS) # Please do not even think about changing the alphabet below into A-Za-z. # It is there for purpose. (Bug #602093) diff --git a/libs/gst/check/gstcheck.c b/libs/gst/check/gstcheck.c index 3d75b54..a803961 100644 --- a/libs/gst/check/gstcheck.c +++ b/libs/gst/check/gstcheck.c @@ -1012,3 +1012,27 @@ gst_check_object_destroyed_on_unref (gpointer object_to_unref) { gst_check_objects_destroyed_on_unref (object_to_unref, NULL, NULL); } + +/* For ABI compatibility with GStreamer < 1.5 */ +void +_fail_unless (int result, const char *file, int line, const char *expr, ...) +G_GNUC_PRINTF (4, 5); + +void _fail_unless (int result, const char *file, int line, + const char *expr, ...) +{ + gchar *msg; + va_list args; + + if (result) { + _mark_point(file, line); + return; + } + + va_start (args, expr); + msg = g_strdup_vprintf (expr, args); + va_end (args); + + _ck_assert_failed (file, line, msg, NULL); + g_free (msg); +}