summaryrefslogtreecommitdiff
path: root/pango
diff options
context:
space:
mode:
Diffstat (limited to 'pango')
-rw-r--r--pango/modules.c22
-rw-r--r--pango/pango-utils.c30
2 files changed, 27 insertions, 25 deletions
diff --git a/pango/modules.c b/pango/modules.c
index 094b8f5d..b7868dbb 100644
--- a/pango/modules.c
+++ b/pango/modules.c
@@ -244,6 +244,28 @@ process_module_file (FILE *module_file)
{
case 0:
pair->load_info = g_strdup (tmp_buf->str);
+#ifdef G_OS_WIN32
+ if (strncmp (pair->load_info,
+ LIBDIR "/pango/modules/",
+ strlen (LIBDIR "/pango/modules/")) == 0)
+ {
+ /* This is an entry put there by make install on the
+ * packager's system. On Windows a prebuilt Pango
+ * package can be installed in a random
+ * location. The pango.modules file distributed in
+ * such a package contains paths from the package
+ * builder's machine. Replace the path with the real
+ * one on this machine. */
+ gchar *tem = pair->load_info;
+ pair->load_info =
+ g_strconcat (pango_get_lib_subdirectory (),
+ "\\modules\\",
+ tem + strlen (LIBDIR "/pango/modules/"),
+ NULL);
+ g_free (tem);
+ }
+
+#endif
break;
case 1:
pair->info.id = g_strdup (tmp_buf->str);
diff --git a/pango/pango-utils.c b/pango/pango-utils.c
index 428b983a..e7ee0bab 100644
--- a/pango/pango-utils.c
+++ b/pango/pango-utils.c
@@ -626,37 +626,17 @@ pango_config_key_get (const char *key)
return g_strdup (g_hash_table_lookup (config_hash, key));
}
-#ifdef G_OS_WIN32
-
/* DllMain function needed to tuck away the DLL name */
-static char dll_name[MAX_PATH];
-
-BOOL WINAPI
-DllMain (HINSTANCE hinstDLL,
- DWORD fdwReason,
- LPVOID lpvReserved)
-{
- switch (fdwReason)
- {
- case DLL_PROCESS_ATTACH:
- GetModuleFileName ((HMODULE) hinstDLL, dll_name, sizeof (dll_name));
- break;
- }
-
- return TRUE;
-}
+G_WIN32_DLLMAIN_FOR_DLL_NAME(static, dll_name)
-#endif /* G_OS_WIN32 */
/**
* pango_get_sysconf_subdirectory:
*
* On Unix, returns the name of the "pango" subdirectory of SYSCONFDIR
- * (which is set at compile time). On Win32, returns the Pango
- * installation directory (which is set at installation time, and
- * stored in the registry). The returned string should not be
- * freed.
+ * (which is set at compile time). On Win32, returns a subdirectory of
+ * the Pango installation directory.
*
* Return value: the Pango sysconf directory. The returned string should
* not be freed.
@@ -669,7 +649,7 @@ pango_get_sysconf_subdirectory (void)
if (result == NULL)
result = g_win32_get_package_installation_subdirectory
- (PACKAGE " " VERSION, g_path_get_basename (dll_name), "etc\\pango");
+ (PACKAGE " " VERSION, dll_name, "etc\\pango");
return result;
#else
@@ -697,7 +677,7 @@ pango_get_lib_subdirectory (void)
if (result == NULL)
result = g_win32_get_package_installation_subdirectory
- (PACKAGE " " VERSION, g_path_get_basename (dll_name), "lib\\pango");
+ (PACKAGE " " VERSION, dll_name, "lib\\pango");
return result;
#else