Skip to content

Commit

Permalink
Work around g_memdup deprecation
Browse files Browse the repository at this point in the history
  • Loading branch information
evanmiller committed Jul 24, 2021
1 parent d143996 commit 62ce520
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
3 changes: 2 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ fi
AC_SUBST(GTK3_CFLAGS)
AC_SUBST(GTK3_LIBS)

AC_DEFINE(HAVE_GLIB, 1, [glib check])
AC_DEFINE([HAVE_GLIB], [1], [glib check])
AC_CHECK_LIB(glib-2.0, g_memdup2, [AC_DEFINE([HAVE_G_MEMDUP2], [1], [g_memdup2 check])])

GLIB_GSETTINGS

Expand Down
2 changes: 1 addition & 1 deletion src/debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ gmdb_nav_add_page(GtkWidget *win, guint32 page_num)
}
}

nav_list = g_list_append(nav_list, g_memdup(&page_num, 4));
nav_list = g_list_append(nav_list, g_memdup2(&page_num, 4));
*nav_elem = g_list_length(nav_list);

g_object_set_data(G_OBJECT(win), "nav_list", nav_list);
Expand Down
4 changes: 4 additions & 0 deletions src/gmdb.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
#include <mdbtools.h>
#include <mdbsql.h>

#ifndef HAVE_G_MEMDUP2
#define g_memdup2(p, sz) g_memdup(p, sz)
#endif

#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
Expand Down

0 comments on commit 62ce520

Please sign in to comment.