mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-18 22:36:33 +00:00
7a478fbdbd
Original commit message from CVS: * gst/glib-compat-private.h: Add compatibility macro for g_intern_string() for GLib-2.8 (any reason we can't just bump the requirement to at least 2.10?) * gst/gstpadtemplate.h: * gst/gstelementfactory.c: * gst/gstregistryxml.c: * gst/gstregistrybinary.c: Make GstStaticPadTemplate's templ_name field a const gchar * and fix up the internal code accordingly. This shouldn't be a problem, since there is no reason external code could ever assume the string in such a structure is dynamically allocated unless it did that itself; the use of g_strdup() is private to element factories. The new code also saves some memory by putting pad template name strings into the GLib quark table instead of allocating them dynamically. Declaring this field constant fixes warnings with g++-4.2 when using the GST_STATIC_PAD_TEMPLATE macro in c++ code (#478092).
22 lines
398 B
C
22 lines
398 B
C
/*
|
|
* glib-compat.c
|
|
* Functions copied from glib 2.10
|
|
*
|
|
* Copyright 2005 David Schleef <ds@schleef.org>
|
|
*/
|
|
|
|
#include "gst_private.h" /* for g_warning */
|
|
#include <glib.h>
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
/* copies */
|
|
|
|
/* adaptations */
|
|
|
|
/* FIXME: remove once we depend on GLib 2.10 */
|
|
#if (!GLIB_CHECK_VERSION (2, 10, 0))
|
|
#define g_intern_string(s) g_quark_to_string(g_quark_from_string(s))
|
|
#endif
|
|
|
|
G_END_DECLS
|