From f1bcc9c8a7692ed5d60e55c2b96e354cda92c6e0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ole=20Andr=C3=A9=20Vadla=20Ravn=C3=A5s?= Date: Wed, 7 May 2008 19:24:44 +0000 Subject: [PATCH] gst/gstinfo.c (gst_debug_log_valist): Improved the __FILE__ part of debug output for MSVC. Original commit message from CVS: * gst/gstinfo.c (gst_debug_log_valist): Improved the __FILE__ part of debug output for MSVC. --- ChangeLog | 5 +++++ gst/gstinfo.c | 17 +++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/ChangeLog b/ChangeLog index 5aa8fb7..c9e6ce2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2008-05-07 Ole André Vadla Ravnås + * gst/gstinfo.c (gst_debug_log_valist): + Improved the __FILE__ part of debug output for MSVC. + +2008-05-07 Ole André Vadla Ravnås + * libs/gst/base/gstbasesrc.c (gst_base_src_default_query): Declaration after statement fix for compilers like MSVC. diff --git a/gst/gstinfo.c b/gst/gstinfo.c index db7333e..b928049 100644 --- a/gst/gstinfo.c +++ b/gst/gstinfo.c @@ -412,11 +412,24 @@ gst_debug_log_valist (GstDebugCategory * category, GstDebugLevel level, LogFuncEntry *entry; GSList *handler; +#ifdef _MSC_VER + gchar *file_basename; +#endif + g_return_if_fail (category != NULL); g_return_if_fail (file != NULL); g_return_if_fail (function != NULL); g_return_if_fail (format != NULL); +#ifdef _MSC_VER + /* + * The predefined macro __FILE__ is always the exact path given to the + * compiler with MSVC, which may or may not be the basename. We work + * around it at runtime to improve the readability. + */ + file = file_basename = g_path_get_basename (file); +#endif + message.message = NULL; message.format = format; G_VA_COPY (message.arguments, args); @@ -430,6 +443,10 @@ gst_debug_log_valist (GstDebugCategory * category, GstDebugLevel level, } g_free (message.message); va_end (message.arguments); + +#ifdef _MSC_VER + g_free (file_basename); +#endif } /** -- 2.7.4