Commit b54bf317 authored by Gwenole Beauchesne's avatar Gwenole Beauchesne

Add glib compatibility glue for older versions.

parent 0fb1147d
......@@ -147,6 +147,9 @@ AC_SUBST(GTKDOC_VERSION)
dnl Check for GLib
AC_PATH_PROG([GLIB_GENMARSHAL], [glib-genmarshal])
PKG_CHECK_MODULES([GLIB], [glib-2.0])
AC_CHECK_LIB([glib-2.0], [g_list_free_full], [
AC_DEFINE([HAVE_G_LIST_FREE_FULL], [1],
[Define to 1 if g_list_free_full() is available.])])
AC_SUBST(GLIB_CFLAGS)
AC_SUBST(GLIB_LIBS)
......
......@@ -76,6 +76,7 @@ libgstvaapi_source_h = \
$(NULL)
libgstvaapi_source_priv_h = \
glibcompat.h \
gstvaapi_priv.h \
gstvaapicompat.h \
gstvaapidebug.h \
......
/*
* glibcompat.h - System-dependent definitions
*
* Copyright (C) 2012 Intel Corporation
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2.1
* of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA
*/
#ifndef GLIB_COMPAT_H
#define GLIB_COMPAT_H
#include <glib.h>
#ifndef HAVE_G_LIST_FREE_FULL
static inline void
g_list_free_full(GList *list, GDestroyNotify free_func)
{
g_list_foreach(list, (GFunc)free_func, NULL);
g_list_free(list);
}
#endif
#endif /* GLIB_COMPAT_H */
......@@ -26,4 +26,6 @@
# include "config.h"
#endif
#include "glibcompat.h"
#endif /* SYSDEPS_H */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment