New function (DLL entry point) to tuck away actual DLL name.
authorTor Lillqvist <tml@iki.fi>
Wed, 3 Oct 2001 20:19:13 +0000 (20:19 +0000)
committerTor Lillqvist <tml@src.gnome.org>
Wed, 3 Oct 2001 20:19:13 +0000 (20:19 +0000)
2001-10-03  Tor Lillqvist  <tml@iki.fi>

* glib/gutils.c (Win32) (DllMain): New function (DLL entry point)
to tuck away actual DLL name.
(GLIB_LOCALE_DIR) Use actual DLL name, instead of assuming one
naming convention for DLLs.

* glib/glib.def: g_string_append_printf.

ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-12
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
glib/glib.def
glib/gutils.c
glib/gwin32.c

index 8d5967d..bcd9d19 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2001-10-03  Tor Lillqvist  <tml@iki.fi>
+
+       * glib/gutils.c (Win32) (DllMain): New function (DLL entry point)
+       to tuck away actual DLL name.
+       (GLIB_LOCALE_DIR) Use actual DLL name, instead of assuming one
+       naming convention for DLLs.
+
+       * glib/glib.def: g_string_append_printf.
+
 2001-10-02  Matthias Clasen  <matthiasc@poet.de>
 
        * glib/gstrfuncs.c, glib/giochannel.c: documentation update.
index 8d5967d..bcd9d19 100644 (file)
@@ -1,3 +1,12 @@
+2001-10-03  Tor Lillqvist  <tml@iki.fi>
+
+       * glib/gutils.c (Win32) (DllMain): New function (DLL entry point)
+       to tuck away actual DLL name.
+       (GLIB_LOCALE_DIR) Use actual DLL name, instead of assuming one
+       naming convention for DLLs.
+
+       * glib/glib.def: g_string_append_printf.
+
 2001-10-02  Matthias Clasen  <matthiasc@poet.de>
 
        * glib/gstrfuncs.c, glib/giochannel.c: documentation update.
index 8d5967d..bcd9d19 100644 (file)
@@ -1,3 +1,12 @@
+2001-10-03  Tor Lillqvist  <tml@iki.fi>
+
+       * glib/gutils.c (Win32) (DllMain): New function (DLL entry point)
+       to tuck away actual DLL name.
+       (GLIB_LOCALE_DIR) Use actual DLL name, instead of assuming one
+       naming convention for DLLs.
+
+       * glib/glib.def: g_string_append_printf.
+
 2001-10-02  Matthias Clasen  <matthiasc@poet.de>
 
        * glib/gstrfuncs.c, glib/giochannel.c: documentation update.
index 8d5967d..bcd9d19 100644 (file)
@@ -1,3 +1,12 @@
+2001-10-03  Tor Lillqvist  <tml@iki.fi>
+
+       * glib/gutils.c (Win32) (DllMain): New function (DLL entry point)
+       to tuck away actual DLL name.
+       (GLIB_LOCALE_DIR) Use actual DLL name, instead of assuming one
+       naming convention for DLLs.
+
+       * glib/glib.def: g_string_append_printf.
+
 2001-10-02  Matthias Clasen  <matthiasc@poet.de>
 
        * glib/gstrfuncs.c, glib/giochannel.c: documentation update.
index 8d5967d..bcd9d19 100644 (file)
@@ -1,3 +1,12 @@
+2001-10-03  Tor Lillqvist  <tml@iki.fi>
+
+       * glib/gutils.c (Win32) (DllMain): New function (DLL entry point)
+       to tuck away actual DLL name.
+       (GLIB_LOCALE_DIR) Use actual DLL name, instead of assuming one
+       naming convention for DLLs.
+
+       * glib/glib.def: g_string_append_printf.
+
 2001-10-02  Matthias Clasen  <matthiasc@poet.de>
 
        * glib/gstrfuncs.c, glib/giochannel.c: documentation update.
index 8d5967d..bcd9d19 100644 (file)
@@ -1,3 +1,12 @@
+2001-10-03  Tor Lillqvist  <tml@iki.fi>
+
+       * glib/gutils.c (Win32) (DllMain): New function (DLL entry point)
+       to tuck away actual DLL name.
+       (GLIB_LOCALE_DIR) Use actual DLL name, instead of assuming one
+       naming convention for DLLs.
+
+       * glib/glib.def: g_string_append_printf.
+
 2001-10-02  Matthias Clasen  <matthiasc@poet.de>
 
        * glib/gstrfuncs.c, glib/giochannel.c: documentation update.
index 8d5967d..bcd9d19 100644 (file)
@@ -1,3 +1,12 @@
+2001-10-03  Tor Lillqvist  <tml@iki.fi>
+
+       * glib/gutils.c (Win32) (DllMain): New function (DLL entry point)
+       to tuck away actual DLL name.
+       (GLIB_LOCALE_DIR) Use actual DLL name, instead of assuming one
+       naming convention for DLLs.
+
+       * glib/glib.def: g_string_append_printf.
+
 2001-10-02  Matthias Clasen  <matthiasc@poet.de>
 
        * glib/gstrfuncs.c, glib/giochannel.c: documentation update.
index 8d5967d..bcd9d19 100644 (file)
@@ -1,3 +1,12 @@
+2001-10-03  Tor Lillqvist  <tml@iki.fi>
+
+       * glib/gutils.c (Win32) (DllMain): New function (DLL entry point)
+       to tuck away actual DLL name.
+       (GLIB_LOCALE_DIR) Use actual DLL name, instead of assuming one
+       naming convention for DLLs.
+
+       * glib/glib.def: g_string_append_printf.
+
 2001-10-02  Matthias Clasen  <matthiasc@poet.de>
 
        * glib/gstrfuncs.c, glib/giochannel.c: documentation update.
index e73bb08..ec1b9ff 100644 (file)
@@ -546,6 +546,7 @@ EXPORTS
        g_string_append
        g_string_append_c
        g_string_append_len
+       g_string_append_printf
        g_string_append_unichar
        g_string_ascii_down
        g_string_assign
@@ -568,7 +569,6 @@ EXPORTS
        g_string_prepend_len
        g_string_prepend_unichar
        g_string_printf
-       g_string_printfa
        g_string_sized_new
        g_string_truncate
        g_string_up
@@ -695,5 +695,5 @@ EXPORTS
 ; and vice versa, i.e.:
 ; compatibility of Dia 0.87 with tml's latest Gtk+ version (2000-12-26)
        g_dirname=g_path_get_dirname
-       g_string_sprintfa=g_string_printfa
+       g_string_sprintfa=g_string_append_printf
        g_string_sprintf=g_string_printf
index 8f08e81..b3bfa27 100644 (file)
@@ -1098,18 +1098,37 @@ g_get_codeset (void)
 
 #ifdef G_OS_WIN32
 
+/* DllMain function needed to tuck away the GLib 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;
+}
+
 /* On Windows we don't want any hard-coded path names */
 
 #undef GLIB_LOCALE_DIR
-/* It's OK to leak the g_win32_get_...() and g_strdup_printf() results
- * below, as this macro is called only once. */
+/* It's OK to leak the g_win32_get_...() and g_path_get_basename() results
+ * below, as this macro is called only once.
+ * Use the actual DLL name of the GLib DLL, i.e. don't assume the
+ * GLib DLL has a certain name.
+ */
 #define GLIB_LOCALE_DIR                                                \
   g_win32_get_package_installation_subdirectory                        \
   (GETTEXT_PACKAGE,                                            \
-   g_strdup_printf ("libglib-%d.%d-%d.dll",                    \
-                   GLIB_MAJOR_VERSION,                         \
-                   GLIB_MINOR_VERSION,                         \
-                   GLIB_MICRO_VERSION - GLIB_BINARY_AGE),      \
+   g_path_get_basename (dll_name),                             \
    "share\\locale")
 
 #endif /* !G_OS_WIN32 */
@@ -1129,5 +1148,3 @@ _glib_gettext (const gchar *str)
 }
 
 #endif /* ENABLE_NLS */
-
-
index 0604c1f..99741e1 100644 (file)
@@ -220,7 +220,7 @@ g_win32_ftruncate (gint  fd,
  * returned string should be deallocated with g_free().
  *
  * Returns: newly-allocated locale name.
- */
+ **/
 
 gchar *
 g_win32_getlocale (void)
@@ -551,7 +551,7 @@ g_win32_getlocale (void)
  * The returned string should be deallocated with g_free().
  *
  * Returns: newly-allocated error message
- */
+ **/
 gchar *
 g_win32_error_message (gint error)
 {
@@ -674,7 +674,6 @@ get_package_directory_from_module (gchar *module_name)
  * The return value should be freed with g_free() when not needed any longer.
  **/
 
-
 gchar *
 g_win32_get_package_installation_directory (gchar *package,
                                            gchar *dll_name)
@@ -756,7 +755,7 @@ g_win32_get_package_installation_directory (gchar *package,
  * g_win32_get_package_installation_directory() with the @package and
  * @dll_name parameters. The return value should be freed with
  * g_free() when no longer needed.
- */
+ **/
 
 gchar *
 g_win32_get_package_installation_subdirectory (gchar *package,