pango r2718 - in trunk: . pango



Author: tml
Date: Sat Sep 13 19:57:37 2008
New Revision: 2718
URL: http://svn.gnome.org/viewvc/pango?rev=2718&view=rev

Log:
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.



Modified:
   trunk/ChangeLog
   trunk/pango/pango-utils.c

Modified: trunk/pango/pango-utils.c
==============================================================================
--- trunk/pango/pango-utils.c	(original)
+++ trunk/pango/pango-utils.c	Sat Sep 13 19:57:37 2008
@@ -657,18 +657,34 @@
 
 #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 @@
   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_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 @@
   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";



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]