summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog9
-rw-r--r--pango/pango-utils.c49
2 files changed, 43 insertions, 15 deletions
diff --git a/ChangeLog b/ChangeLog
index 40a88c5b..8ec79577 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2008-09-13 Tor Lillqvist <tml@novell.com>
+
+ * pango/pango-utils.c: Don't use the deprectated
+ g_win32_get_package_installation_subdirectory(). Use
+ g_win32_get_package_installation_directory_of_module()
+ instead. Also, don't use the deprecated silly
+ G_WIN32_DLLMAIN_FOR_DLL_NAME() macro, but an explicit minimal
+ DllMain() that just saves the DLL handle.
+
2008-09-11 Behdad Esfahbod <behdad@gnome.org>
Bug 551865 – Can't change justification of a PangoLayout after first
diff --git a/pango/pango-utils.c b/pango/pango-utils.c
index f6beaef8..fae4e7f2 100644
--- a/pango/pango-utils.c
+++ b/pango/pango-utils.c
@@ -657,18 +657,34 @@ pango_config_key_get (const char *key)
#ifdef G_OS_WIN32
-/* DllMain function needed to tuck away the DLL name */
+/* DllMain function needed to tuck away the DLL handle */
+
+static HMODULE pango_dll;
+
+BOOL WINAPI
+DllMain (HINSTANCE hinstDLL,
+ DWORD fdwReason,
+ LPVOID lpvReserved)
+{
+ switch (fdwReason)
+ {
+ case DLL_PROCESS_ATTACH:
+ pango_dll = (HMODULE) hinstDLL;
+ break;
+ }
+
+ return TRUE;
+}
-G_WIN32_DLLMAIN_FOR_DLL_NAME(static, dll_name)
#endif
/**
* pango_get_sysconf_subdirectory:
*
* On Unix, returns the name of the "pango" subdirectory of SYSCONFDIR
- * (which is set at compile time). On Win32, returns a subdirectory of
- * the Pango installation directory (which is deduced at run time from
- * the DLL's location, or stored in the Registry).
+ * (which is set at compile time). On Windows, returns the etc\pango
+ * subdirectory of the Pango installation directory (which is deduced
+ * at run time from the DLL's location).
*
* Return value: the Pango sysconf directory. The returned string should
* not be freed.
@@ -680,9 +696,11 @@ pango_get_sysconf_subdirectory (void)
static gchar *result = NULL;
if (result == NULL)
- result = g_win32_get_package_installation_subdirectory
- (PACKAGE " " VERSION, dll_name, "etc\\pango");
-
+ {
+ gchar *root = g_win32_get_package_installation_directory_of_module (pango_dll);
+ result = g_build_filename (root, "etc\\pango", NULL);
+ g_free (root);
+ }
return result;
#else
return SYSCONFDIR "/pango";
@@ -693,10 +711,9 @@ pango_get_sysconf_subdirectory (void)
* pango_get_lib_subdirectory:
*
* On Unix, returns the name of the "pango" subdirectory of LIBDIR
- * (which is set at compile time). On Win32, returns the Pango
- * installation directory (which is deduced at run time from the DLL's
- * location, or stored in the Registry). The returned string should
- * not be freed.
+ * (which is set at compile time). On Windows, returns the lib\pango
+ * subdirectory of the Pango installation directory (which is deduced
+ * at run time from the DLL's location).
*
* Return value: the Pango lib directory. The returned string should
* not be freed.
@@ -708,9 +725,11 @@ pango_get_lib_subdirectory (void)
static gchar *result = NULL;
if (result == NULL)
- result = g_win32_get_package_installation_subdirectory
- (PACKAGE " " VERSION, dll_name, "lib\\pango");
-
+ {
+ gchar *root = g_win32_get_package_installation_directory_of_module (pango_dll);
+ result = g_build_filename (root, "lib\\pango", NULL);
+ g_free (root);
+ }
return result;
#else
return LIBDIR "/pango";