mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-14 00:06:24 +01:00
Use g_memdup2() with newer versions of GLib
The g_memdup() function has been deprecated, so we should use the new g_memdup2() function if available.
This commit is contained in:
parent
b305534719
commit
7cfb47308b
@ -128,7 +128,15 @@ g_constant_info_get_value (GIConstantInfo *info,
|
|||||||
if (blob->type.flags.reserved == 0 && blob->type.flags.reserved2 == 0)
|
if (blob->type.flags.reserved == 0 && blob->type.flags.reserved2 == 0)
|
||||||
{
|
{
|
||||||
if (blob->type.flags.pointer)
|
if (blob->type.flags.pointer)
|
||||||
value->v_pointer = g_memdup (&rinfo->typelib->data[blob->offset], blob->size);
|
{
|
||||||
|
#if GLIB_CHECK_VERSION (2, 67, 5)
|
||||||
|
gsize blob_size = blob->size;
|
||||||
|
|
||||||
|
value->v_pointer = g_memdup2 (&rinfo->typelib->data[blob->offset], blob_size);
|
||||||
|
#else
|
||||||
|
value->v_pointer = g_memdup (&rinfo->typelib->data[blob->offset], blob->size);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
switch (blob->type.flags.tag)
|
switch (blob->type.flags.tag)
|
||||||
|
Loading…
Reference in New Issue
Block a user