Replace g_memdup with safer g_memdup2
[geeqie.git] / src / exiv2.cc
index 145ce30..a2c16c4 100644 (file)
@@ -52,7 +52,6 @@
 #define EXV_PACKAGE "exiv2"
 #endif
 
-extern "C" {
 #include <glib.h>
 
 #include "main.h"
@@ -62,7 +61,6 @@ extern "C" {
 #include "ui-fileops.h"
 
 #include "misc.h"
-}
 
 typedef struct _AltKey AltKey;
 
@@ -269,7 +267,11 @@ public:
                if (cp_data_)
                {
                        if (data_len) *data_len = cp_length_;
+#if GLIB_CHECK_VERSION(2,68,0)
+                       return (unsigned char *) g_memdup2(cp_data_, cp_length_);
+#else
                        return (unsigned char *) g_memdup(cp_data_, cp_length_);
+#endif
                }
                return NULL;
        }
@@ -286,9 +288,7 @@ public:
        }
 };
 
-extern "C" {
 static void _ExifDataProcessed_update_xmp(gpointer key, gpointer value, gpointer data);
-}
 
 // This allows read-write access to the metadata
 struct _ExifDataProcessed : public _ExifData
@@ -442,7 +442,6 @@ public:
 
 
 
-extern "C" {
 
 
 void exif_init(void)
@@ -1244,7 +1243,6 @@ void exif_free_preview(guchar *buf)
 }
 #endif
 
-}
 #if !EXIV2_TEST_VERSION(0,17,90)
 
 /* This is a dirty hack to support raw file preview, bassed on
@@ -1279,7 +1277,7 @@ struct _UnmapData
 
 static GList *exif_unmap_list = 0;
 
-extern "C" guchar *exif_get_preview(ExifData *exif, guint *data_len, gint requested_width, gint requested_height)
+guchar *exif_get_preview(ExifData *exif, guint *data_len, gint requested_width, gint requested_height)
 {
        unsigned long offset;