summaryrefslogtreecommitdiff
path: root/pango/querymodules.c
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@redhat.com>2003-08-22 22:52:08 +0000
committerOwen Taylor <otaylor@src.gnome.org>2003-08-22 22:52:08 +0000
commitc9f014f6478e48efd4427efa0f1d1f37a2c3563b (patch)
tree0eb952ac056c945715ecd08e446db3db566cb510 /pango/querymodules.c
parentb9b68dba2e563f320b7c4b3ea73c68bfa1d9a804 (diff)
downloadpango-c9f014f6478e48efd4427efa0f1d1f37a2c3563b.tar.gz
Add some macro definitions for gcc-3.3 that suppress the bogus
Fri Aug 22 18:09:52 2003 Owen Taylor <otaylor@redhat.com> * pango/opentype/fterrcompat.h: Add some macro definitions for gcc-3.3 that suppress the bogus strict-aliasing warnings. * pango/pango-utils.c (read_config_file): Use g_hash_table_new_full() to simplify code and fix gcc-3.3 warnings. * pango/pangox-fontmap.c (pango_x_real_get_coverage_win) * pango/querymodules.c (query_module): Suppress gcc-3.3 warnings. * pango/modules.c (pango_find_map): Fix warning from missing declaration of pango_module_get_type(). * pango/pango-context.c/pango-engine.c: Fix name confusion for pango_get_fallback_shaper().
Diffstat (limited to 'pango/querymodules.c')
-rw-r--r--pango/querymodules.c22
1 files changed, 18 insertions, 4 deletions
diff --git a/pango/querymodules.c b/pango/querymodules.c
index 2c6542dc..88075628 100644
--- a/pango/querymodules.c
+++ b/pango/querymodules.c
@@ -84,6 +84,20 @@ escape_string (const char *str)
return g_string_free (result, FALSE);
}
+/* Suppresses strict-aliasing warnings for gcc >= 3.3 */
+#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)
+#define GET_SYMBOL(module,name,location) ({ \
+ gboolean result; \
+ void *tmp; \
+ result = g_module_symbol (module, name, &tmp); \
+ location = (typeof(location))tmp; \
+ result; \
+})
+#else
+#define GET_SYMBOL(module,name,location) \
+ g_module_symbol (module, name, (gpointer *)&location);
+#endif
+
void
query_module (const char *dir, const char *name)
{
@@ -106,10 +120,10 @@ query_module (const char *dir, const char *name)
g_printerr ("Cannot load module %s: %s\n", path, g_module_error ());
if (module &&
- g_module_symbol (module, "script_engine_list", (gpointer *) &list) &&
- g_module_symbol (module, "script_engine_init", (gpointer *) &init) &&
- g_module_symbol (module, "script_engine_exit", (gpointer *) &exit) &&
- g_module_symbol (module, "script_engine_create", (gpointer *) &create))
+ GET_SYMBOL (module, "script_engine_list", list) &&
+ GET_SYMBOL (module, "script_engine_init", init) &&
+ GET_SYMBOL (module, "script_engine_exit", exit) &&
+ GET_SYMBOL (module, "script_engine_create", create))
{
gint i,j;
PangoEngineInfo *engines;