trivial: Use g_memdup2() on newer GLib versions

This commit is contained in:
Richard Hughes 2021-04-23 19:31:41 +01:00 committed by Mario Limonciello
parent 99832622e1
commit 88eef48f36

View File

@ -56,9 +56,11 @@ static FlashromLayout *
create_flash_layout (void)
{
struct flashrom_layout *out = g_new (FlashromLayout, 1);
struct romentry *entries = g_memdup (ENTRIES_TEMPLATE, sizeof (ENTRIES_TEMPLATE));
out->entries = entries;
#if GLIB_CHECK_VERSION(2,67,3)
out->entries = g_memdup2 (ENTRIES_TEMPLATE, sizeof (ENTRIES_TEMPLATE));
#else
out->entries = g_memdup (ENTRIES_TEMPLATE, sizeof (ENTRIES_TEMPLATE));
#endif
out->num_entries = sizeof (ENTRIES_TEMPLATE) / sizeof (*ENTRIES_TEMPLATE);
return out;
}