]> Pileus Git - grits/blobdiff - src/gis/gis-plugin.c
Lots of work on libGIS
[grits] / src / gis / gis-plugin.c
index 6888b484d8dba073cd1cb2fd8577cab6843ccf44..4bfab58d71afb8d634ebd7b6d7a5957b180eb01e 100644 (file)
@@ -20,6 +20,9 @@
 
 #include "gis-plugin.h"
 
+/********************
+ * Plugin interface *
+ ********************/
 static void gis_plugin_base_init(gpointer g_class)
 {
        static gboolean is_initialized = FALSE;
@@ -56,7 +59,10 @@ GtkWidget *gis_plugin_get_config(GisPlugin *self)
        return GIS_PLUGIN_GET_INTERFACE(self)->get_config(self);
 }
 
-/* Plugins API */
+
+/***************
+ * Plugins API *
+ ***************/
 typedef struct {
        gchar *name;
        GisPlugin *plugin;
@@ -107,9 +113,9 @@ GisPlugin *gis_plugins_load(GisPlugins *self, const char *name,
                return NULL;
        }
 
-       GisPluginConstructor constructor;
+       gpointer constructor_ptr; // GCC 4.1 fix?
        gchar *constructor_str = g_strconcat("gis_plugin_", name, "_new", NULL);
-       if (!g_module_symbol(module, constructor_str, (gpointer*)&constructor)) {
+       if (!g_module_symbol(module, constructor_str, &constructor_ptr)) {
                g_warning("Unable to load symbol %s from %s: %s",
                                constructor_str, name, g_module_error());
                g_module_close(module);
@@ -117,6 +123,7 @@ GisPlugin *gis_plugins_load(GisPlugins *self, const char *name,
                return NULL;
        }
        g_free(constructor_str);
+       GisPluginConstructor constructor = constructor_ptr;
 
        GisPluginStore *store = g_malloc(sizeof(GisPluginStore));
        store->name = g_strdup(name);