mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-25 03:32:12 +01:00
Substitute deprecated Glib symbol: g_mapped_file_free
glib-compat.h file created to use g_mapped_file_unref only if glib >= 2.22 is available https://bugzilla.gnome.org/show_bug.cgi?id=603727
This commit is contained in:
parent
b50974235b
commit
e568b5f9fd
13
Makefile.am
13
Makefile.am
@ -9,16 +9,17 @@ lib_LTLIBRARIES = libgirepository-1.0.la
|
|||||||
noinst_LTLIBRARIES = libgirepository-parser.la
|
noinst_LTLIBRARIES = libgirepository-parser.la
|
||||||
|
|
||||||
libgirepository_1_0_la_SOURCES = \
|
libgirepository_1_0_la_SOURCES = \
|
||||||
girepository.c \
|
gdump.c \
|
||||||
gtypelib.h \
|
|
||||||
gtypelib.c \
|
|
||||||
gfield.c \
|
gfield.c \
|
||||||
ginfo.h \
|
|
||||||
ginfo.c \
|
ginfo.c \
|
||||||
|
ginfo.h \
|
||||||
|
ginvoke.c \
|
||||||
|
girepository.c \
|
||||||
girffi.c \
|
girffi.c \
|
||||||
girffi.h \
|
girffi.h \
|
||||||
gdump.c \
|
glib-compat.h \
|
||||||
ginvoke.c
|
gtypelib.c \
|
||||||
|
gtypelib.h
|
||||||
|
|
||||||
libgirepository_1_0_la_CPPFLAGS = $(GIREPO_CFLAGS)
|
libgirepository_1_0_la_CPPFLAGS = $(GIREPO_CFLAGS)
|
||||||
libgirepository_1_0_la_LIBADD = $(GIREPO_LIBS)
|
libgirepository_1_0_la_LIBADD = $(GIREPO_LIBS)
|
||||||
|
@ -31,6 +31,7 @@
|
|||||||
#include "girepository.h"
|
#include "girepository.h"
|
||||||
#include "gtypelib.h"
|
#include "gtypelib.h"
|
||||||
#include "ginfo.h"
|
#include "ginfo.h"
|
||||||
|
#include "glib-compat.h"
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
@ -1039,7 +1040,7 @@ compare_candidate_reverse (struct NamespaceVersionCandidadate *c1,
|
|||||||
static void
|
static void
|
||||||
free_candidate (struct NamespaceVersionCandidadate *candidate)
|
free_candidate (struct NamespaceVersionCandidadate *candidate)
|
||||||
{
|
{
|
||||||
g_mapped_file_free (candidate->mfile);
|
g_mapped_file_unref (candidate->mfile);
|
||||||
g_free (candidate->path);
|
g_free (candidate->path);
|
||||||
g_free (candidate->version);
|
g_free (candidate->version);
|
||||||
g_free (candidate);
|
g_free (candidate);
|
||||||
|
24
glib-compat.h
Normal file
24
glib-compat.h
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
/* GObject introspection: Compatibility definitions
|
||||||
|
*
|
||||||
|
* Copyright (C) 2009 Javier Jardón
|
||||||
|
*
|
||||||
|
* 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 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., 59 Temple Place - Suite 330,
|
||||||
|
* Boston, MA 02111-1307, USA.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#if !GLIB_CHECK_VERSION(2,22,0)
|
||||||
|
#define g_mapped_file_unref(x) g_mapped_file_free(x)
|
||||||
|
#endif
|
@ -26,6 +26,7 @@
|
|||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "gtypelib.h"
|
#include "gtypelib.h"
|
||||||
|
#include "glib-compat.h"
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
GTypelib *typelib;
|
GTypelib *typelib;
|
||||||
@ -2134,7 +2135,7 @@ void
|
|||||||
g_typelib_free (GTypelib *typelib)
|
g_typelib_free (GTypelib *typelib)
|
||||||
{
|
{
|
||||||
if (typelib->mfile)
|
if (typelib->mfile)
|
||||||
g_mapped_file_free (typelib->mfile);
|
g_mapped_file_unref (typelib->mfile);
|
||||||
else
|
else
|
||||||
if (typelib->owns_memory)
|
if (typelib->owns_memory)
|
||||||
g_free (typelib->data);
|
g_free (typelib->data);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user