Move the mixed module check function

This is only called in one place, move the function there.
This commit is contained in:
Matthias Clasen 2018-02-18 09:31:22 -05:00
parent 5b4082ac87
commit 7272610a02
3 changed files with 28 additions and 30 deletions

View File

@ -545,6 +545,34 @@ setlocale_initialization (void)
}
}
/* Return TRUE if module_to_check causes version conflicts.
* If module_to_check is NULL, check the main module.
*/
static gboolean
_gtk_module_has_mixed_deps (GModule *module_to_check)
{
GModule *module;
gpointer func;
gboolean result;
if (!module_to_check)
module = g_module_open (NULL, 0);
else
module = module_to_check;
if (g_module_symbol (module, "gtk_progress_get_type", &func))
result = TRUE;
else if (g_module_symbol (module, "gtk_misc_get_type", &func))
result = TRUE;
else
result = FALSE;
if (!module_to_check)
g_module_close (module);
return result;
}
static void
do_pre_parse_initialization (void)
{

View File

@ -186,31 +186,3 @@ _gtk_find_module (const gchar *name,
g_strfreev (paths);
return module_name;
}
/* Return TRUE if module_to_check causes version conflicts.
* If module_to_check is NULL, check the main module.
*/
gboolean
_gtk_module_has_mixed_deps (GModule *module_to_check)
{
GModule *module;
gpointer func;
gboolean result;
if (!module_to_check)
module = g_module_open (NULL, 0);
else
module = module_to_check;
if (g_module_symbol (module, "gtk_progress_get_type", &func))
result = TRUE;
else if (g_module_symbol (module, "gtk_misc_get_type", &func))
result = TRUE;
else
result = FALSE;
if (!module_to_check)
g_module_close (module);
return result;
}

View File

@ -33,8 +33,6 @@ gchar * _gtk_find_module (const gchar *name,
const gchar *type);
gchar ** _gtk_get_module_path (const gchar *type);
gboolean _gtk_module_has_mixed_deps (GModule *module);
G_END_DECLS
#endif /* __GTK_MODULES_PRIVATE_H__ */