Fixed gcc on windows limitation
authorRalf Habacker <ralf.habacker@freenet.de>
Sat, 20 Mar 2010 20:11:10 +0000 (21:11 +0100)
committerunknown <Administrator@.(none)>
Sat, 20 Mar 2010 20:53:57 +0000 (21:53 +0100)
A pointer to a function or variable marked as dllimport
cannot be used as a constant address.

bus/config-loader-expat.c

index 51bbb51..b571fda 100644 (file)
 #include <dbus/dbus-internals.h>
 #include <expat.h>
 
-static XML_Memory_Handling_Suite memsuite =
-{
-  dbus_malloc,
-  dbus_realloc,
-  dbus_free
-};
+static XML_Memory_Handling_Suite memsuite;
 
 typedef struct
 {
@@ -196,7 +191,11 @@ bus_config_load (const DBusString      *file,
       _dbus_string_free (&context.content);
       return NULL;
     }
-  
+
+  memsuite.malloc_fcn = dbus_malloc;
+  memsuite.realloc_fcn = dbus_realloc;
+  memsuite.free_fcn = dbus_free;
+
   expat = XML_ParserCreate_MM ("UTF-8", &memsuite, NULL);
   if (expat == NULL)
     {