Browse Source

We need the g_free symbol in the library

svn path=/trunk/mono/; revision=141253
Gonzalo Paniagua Javier 16 years ago
parent
commit
caf2328cd4
2 changed files with 8 additions and 1 deletions
  1. 1 1
      eglib/src/glib.h
  2. 7 0
      eglib/src/gmem.c

+ 1 - 1
eglib/src/glib.h

@@ -109,7 +109,7 @@ typedef uint16_t       gunichar2;
 /*
  * Allocation
  */
-#define g_free                  free
+void g_free (voir *ptr);
 static inline gpointer g_realloc (gpointer obj, gsize size) { if (!size) {g_free (obj); return 0;} return  realloc (obj, size);}
 static inline gpointer g_malloc (gsize x) {if (x) return malloc (x); else return 0;}
 static inline gpointer g_malloc0 (gsize x) {if (x) return calloc(1,x); else return 0;}

+ 7 - 0
eglib/src/gmem.c

@@ -29,6 +29,13 @@
 #include <string.h>
 #include <glib.h>
 
+void
+g_free (void *ptr)
+{
+	if (ptr != NULL)
+		free (ptr);
+}
+
 gpointer
 g_memdup (gconstpointer mem, guint byte_size)
 {