From cff3cc7ad963539cc42819e1dbac3219f346f5d4 Mon Sep 17 00:00:00 2001 From: Mark Doffman Date: Mon, 10 Mar 2008 17:47:29 +0000 Subject: [PATCH] tools/quote-file.sh tools/compiler.c tools/generate.c 2008-02-22 Mark Doffman * tools/quote-file.sh * tools/compiler.c * tools/generate.c Move to using the 'C' struct compiler code. WARNING: This commit does not compile. It is a partial change. svn path=/trunk/; revision=135 --- girepository/tools/generate.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/girepository/tools/generate.c b/girepository/tools/generate.c index 0f6db6b0f..adb2e24b3 100644 --- a/girepository/tools/generate.c +++ b/girepository/tools/generate.c @@ -1117,12 +1117,17 @@ load_metadata (const gchar *filename, GModule **dlhandle, gsize *len) { - guchar *metadata; + gpointer metadata; gsize *metadata_size; GModule *handle; - handle = g_module_open (filename, G_MODULE_BIND_LOCAL|G_MODULE_BIND_LAZY); - if (!g_module_symbol (handle, "_G_METADATA", (gpointer *) &metadata)) + handle = g_module_open (filename, G_MODULE_BIND_LOCAL|G_MODULE_BIND_LAZY); + if (!handle) + { + g_printerr("Could not load module '%s'\n", filename); + return NULL; + } + if (!g_module_symbol (handle, "_G_METADATA", &metadata)) { g_printerr ("Could not load metadata from '%s': %s\n", filename, g_module_error ()); @@ -1141,7 +1146,7 @@ load_metadata (const gchar *filename, if (dlhandle) *dlhandle = handle; - return metadata; + return *((const guchar **) metadata); } int @@ -1169,7 +1174,7 @@ main (int argc, char *argv[]) for (i = 0; input[i]; i++) { GModule *dlhandle = NULL; - const guchar *metadata; + const guchar *metadata = NULL; gsize len; if (raw)