Revision: 912 http://geany-plugins.svn.sourceforge.net/geany-plugins/?rev=912&view=rev Author: ntrel Date: 2009-09-01 15:37:53 +0000 (Tue, 01 Sep 2009)
Log Message: ----------- Check support library ABI version matches.
Modified Paths: -------------- trunk/geany-plugins/geanylua/ChangeLog trunk/geany-plugins/geanylua/geanylua.c trunk/geany-plugins/geanylua/glspi_init.c
Modified: trunk/geany-plugins/geanylua/ChangeLog =================================================================== --- trunk/geany-plugins/geanylua/ChangeLog 2009-09-01 15:20:22 UTC (rev 911) +++ trunk/geany-plugins/geanylua/ChangeLog 2009-09-01 15:37:53 UTC (rev 912) @@ -1,5 +1,6 @@ September 1, 2009 (ntrel) Try loading system support library if user library fails. + Check support library ABI version matches.
August 31, 2009 (ntrel) Print support library path if Geany is in debug mode.
Modified: trunk/geany-plugins/geanylua/geanylua.c =================================================================== --- trunk/geany-plugins/geanylua/geanylua.c 2009-09-01 15:20:22 UTC (rev 911) +++ trunk/geany-plugins/geanylua/geanylua.c 2009-09-01 15:37:53 UTC (rev 912) @@ -69,6 +69,7 @@
static gchar **glspi_version = NULL; +static guint *glspi_abi = NULL; static InitFunc glspi_init = NULL; static ConfigFunc glspi_configure = NULL; static CleanupFunc glspi_cleanup = NULL; @@ -114,6 +115,7 @@ if (libgeanylua) { g_module_close(libgeanylua); } libgeanylua = NULL; glspi_version = NULL; + glspi_abi = NULL; glspi_init = NULL; glspi_configure = NULL; glspi_cleanup = NULL; @@ -159,6 +161,7 @@ } if ( !( GETSYM("glspi_version", glspi_version) && + GETSYM("glspi_abi", glspi_abi) && GETSYM("glspi_init", glspi_init) && GETSYM("glspi_configure", glspi_configure) && GETSYM("glspi_cleanup", glspi_cleanup) && @@ -175,6 +178,12 @@ fail_init(); return FALSE; } + if (*glspi_abi != GEANY_ABI_VERSION) { + g_printerr(_("%s: Support library ABI mismatch: %s for %s (should be %s)!\n"), + PLUGIN_NAME, *glspi_abi, libname, GEANY_ABI_VERSION); + fail_init(); + return FALSE; + } if (geany->app->debug_mode) { g_printerr("%s: Using support library path: %s\n", PLUGIN_NAME, libname); }
Modified: trunk/geany-plugins/geanylua/glspi_init.c =================================================================== --- trunk/geany-plugins/geanylua/glspi_init.c 2009-09-01 15:20:22 UTC (rev 911) +++ trunk/geany-plugins/geanylua/glspi_init.c 2009-09-01 15:37:53 UTC (rev 912) @@ -30,6 +30,8 @@
PLUGIN_EXPORT const gchar* glspi_version = VERSION; +PLUGIN_EXPORT +const guint glspi_abi = GEANY_ABI_VERSION;
GeanyData *glspi_geany_data=NULL; GeanyFunctions *glspi_geany_functions=NULL;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.