export_symbols = -export-symbols $(srcdir)/gmodule.def
install-libtool-import-lib:
+# Don't put the binary compatibility entries in the import lib!
+ for entry in `grep PRIVATE gmodule.def | sed -e 's/PRIVATE//'`; do \
+ file=`nm -A .libs/libgmodule-2.0.dll.a | tr -d '\r' | grep -m 1 -E $$entry'$$' | cut -d: -f2`; \
+ ar d .libs/libgmodule-2.0.dll.a $$file; \
+ done
$(INSTALL) .libs/libgmodule-2.0.dll.a $(DESTDIR)$(libdir)
$(INSTALL) $(srcdir)/gmodule.def $(DESTDIR)$(libdir)/gmodule-2.0.def
struct _GModule
{
gchar *file_name;
+#ifdef G_OS_WIN32
+ gchar *cp_file_name;
+#endif
gpointer handle;
guint ref_count : 31;
guint is_resident : 1;
{
main_module = g_new (GModule, 1);
main_module->file_name = NULL;
+#ifdef G_OS_WIN32
+ main_module->cp_file_name = NULL;
+#endif
main_module->handle = handle;
main_module->ref_count = 1;
main_module->is_resident = TRUE;
module = g_new (GModule, 1);
module->file_name = g_strdup (file_name);
+#ifdef G_OS_WIN32
+ module->cp_file_name = g_locale_from_utf8 (file_name, -1,
+ NULL, NULL, NULL);
+#endif
module->handle = handle;
module->ref_count = 1;
module->is_resident = FALSE;
return module;
}
+#ifdef G_OS_WIN32
+
+#undef g_module_open
+
+GModule*
+g_module_open (const gchar *file_name,
+ GModuleFlags flags)
+{
+ gchar *utf8_file_name = g_locale_to_utf8 (file_name, -1, NULL, NULL, NULL);
+ GModule *retval = g_module_open_utf8 (utf8_file_name, flags);
+
+ g_free (utf8_file_name);
+
+ return retval;
+}
+
+#endif
+
gboolean
g_module_close (GModule *module)
{
_g_module_close (module->handle, FALSE);
g_free (module->file_name);
-
+#ifdef G_OS_WIN32
+ g_free (module->cp_file_name);
+#endif
g_free (module);
}
return module->file_name;
}
+#ifdef G_OS_WIN32
+
+#undef g_module_name
+
+G_CONST_RETURN gchar*
+g_module_name (GModule *module)
+{
+ g_return_val_if_fail (module != NULL, NULL);
+
+ if (module == main_module)
+ return "main";
+
+ return module->cp_file_name;
+}
+
+#endif
+
gchar*
g_module_build_path (const gchar *directory,
const gchar *module_name)
typedef const gchar* (*GModuleCheckInit) (GModule *module);
typedef void (*GModuleUnload) (GModule *module);
+#ifdef G_OS_WIN32
+#define g_module_open g_module_open_utf8
+#define g_module_name g_module_name_utf8
+#endif
+
/* return TRUE if dynamic module loading is supported */
gboolean g_module_supported (void) G_GNUC_CONST;