New function (DLL entry point) to tuck away actual DLL name.

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.
This commit is contained in:
Tor Lillqvist 2001-10-03 20:19:13 +00:00 committed by Tor Lillqvist
parent 791bfecb79
commit 7ede4e5066
11 changed files with 102 additions and 14 deletions

View 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> 2001-10-02 Matthias Clasen <matthiasc@poet.de>
* glib/gstrfuncs.c, glib/giochannel.c: documentation update. * glib/gstrfuncs.c, glib/giochannel.c: documentation update.

View 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> 2001-10-02 Matthias Clasen <matthiasc@poet.de>
* glib/gstrfuncs.c, glib/giochannel.c: documentation update. * glib/gstrfuncs.c, glib/giochannel.c: documentation update.

View 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> 2001-10-02 Matthias Clasen <matthiasc@poet.de>
* glib/gstrfuncs.c, glib/giochannel.c: documentation update. * glib/gstrfuncs.c, glib/giochannel.c: documentation update.

View 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> 2001-10-02 Matthias Clasen <matthiasc@poet.de>
* glib/gstrfuncs.c, glib/giochannel.c: documentation update. * glib/gstrfuncs.c, glib/giochannel.c: documentation update.

View 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> 2001-10-02 Matthias Clasen <matthiasc@poet.de>
* glib/gstrfuncs.c, glib/giochannel.c: documentation update. * glib/gstrfuncs.c, glib/giochannel.c: documentation update.

View 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> 2001-10-02 Matthias Clasen <matthiasc@poet.de>
* glib/gstrfuncs.c, glib/giochannel.c: documentation update. * glib/gstrfuncs.c, glib/giochannel.c: documentation update.

View 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> 2001-10-02 Matthias Clasen <matthiasc@poet.de>
* glib/gstrfuncs.c, glib/giochannel.c: documentation update. * glib/gstrfuncs.c, glib/giochannel.c: documentation update.

View 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> 2001-10-02 Matthias Clasen <matthiasc@poet.de>
* glib/gstrfuncs.c, glib/giochannel.c: documentation update. * glib/gstrfuncs.c, glib/giochannel.c: documentation update.

View File

@ -546,6 +546,7 @@ EXPORTS
g_string_append g_string_append
g_string_append_c g_string_append_c
g_string_append_len g_string_append_len
g_string_append_printf
g_string_append_unichar g_string_append_unichar
g_string_ascii_down g_string_ascii_down
g_string_assign g_string_assign
@ -568,7 +569,6 @@ EXPORTS
g_string_prepend_len g_string_prepend_len
g_string_prepend_unichar g_string_prepend_unichar
g_string_printf g_string_printf
g_string_printfa
g_string_sized_new g_string_sized_new
g_string_truncate g_string_truncate
g_string_up g_string_up
@ -695,5 +695,5 @@ EXPORTS
; and vice versa, i.e.: ; and vice versa, i.e.:
; compatibility of Dia 0.87 with tml's latest Gtk+ version (2000-12-26) ; compatibility of Dia 0.87 with tml's latest Gtk+ version (2000-12-26)
g_dirname=g_path_get_dirname 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 g_string_sprintf=g_string_printf

View File

@ -1098,18 +1098,37 @@ g_get_codeset (void)
#ifdef G_OS_WIN32 #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 */ /* On Windows we don't want any hard-coded path names */
#undef GLIB_LOCALE_DIR #undef GLIB_LOCALE_DIR
/* It's OK to leak the g_win32_get_...() and g_strdup_printf() results /* It's OK to leak the g_win32_get_...() and g_path_get_basename() results
* below, as this macro is called only once. */ * 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 \ #define GLIB_LOCALE_DIR \
g_win32_get_package_installation_subdirectory \ g_win32_get_package_installation_subdirectory \
(GETTEXT_PACKAGE, \ (GETTEXT_PACKAGE, \
g_strdup_printf ("libglib-%d.%d-%d.dll", \ g_path_get_basename (dll_name), \
GLIB_MAJOR_VERSION, \
GLIB_MINOR_VERSION, \
GLIB_MICRO_VERSION - GLIB_BINARY_AGE), \
"share\\locale") "share\\locale")
#endif /* !G_OS_WIN32 */ #endif /* !G_OS_WIN32 */
@ -1129,5 +1148,3 @@ _glib_gettext (const gchar *str)
} }
#endif /* ENABLE_NLS */ #endif /* ENABLE_NLS */

View File

@ -220,7 +220,7 @@ g_win32_ftruncate (gint fd,
* returned string should be deallocated with g_free(). * returned string should be deallocated with g_free().
* *
* Returns: newly-allocated locale name. * Returns: newly-allocated locale name.
*/ **/
gchar * gchar *
g_win32_getlocale (void) g_win32_getlocale (void)
@ -551,7 +551,7 @@ g_win32_getlocale (void)
* The returned string should be deallocated with g_free(). * The returned string should be deallocated with g_free().
* *
* Returns: newly-allocated error message * Returns: newly-allocated error message
*/ **/
gchar * gchar *
g_win32_error_message (gint error) 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. * The return value should be freed with g_free() when not needed any longer.
**/ **/
gchar * gchar *
g_win32_get_package_installation_directory (gchar *package, g_win32_get_package_installation_directory (gchar *package,
gchar *dll_name) 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 * g_win32_get_package_installation_directory() with the @package and
* @dll_name parameters. The return value should be freed with * @dll_name parameters. The return value should be freed with
* g_free() when no longer needed. * g_free() when no longer needed.
*/ **/
gchar * gchar *
g_win32_get_package_installation_subdirectory (gchar *package, g_win32_get_package_installation_subdirectory (gchar *package,