Remove G_HARDCODED_PATH_WRAPPER, Owen didn't like it.

2001-10-23  Tor Lillqvist  <tml@iki.fi>

	* glib/gutils.h: Remove G_HARDCODED_PATH_WRAPPER, Owen didn't like
 	it.

	* glib/gutils.c: Instead, expand it on Win32 as
 	_glib_get_locale_dir(), and #define GLIB_LOCALE_DIR as a call to
 	it.
This commit is contained in:
Tor Lillqvist 2001-10-23 09:26:54 +00:00 committed by Tor Lillqvist
parent 3984621bd3
commit 0c9c94c6e1
10 changed files with 99 additions and 53 deletions

View File

@ -1,3 +1,12 @@
2001-10-23 Tor Lillqvist <tml@iki.fi>
* glib/gutils.h: Remove G_HARDCODED_PATH_WRAPPER, Owen didn't like
it.
* glib/gutils.c: Instead, expand it on Win32 as
_glib_get_locale_dir(), and #define GLIB_LOCALE_DIR as a call to
it.
2001-10-23 Tor Lillqvist <tml@iki.fi>
* config.h.win32.in: Typo.
@ -13,7 +22,7 @@
G_HARDCODED_PATH_WRAPPER. These are used to avoid hardcoding path
names into Windows DLLs.
* glib/gutils.c: Use them for GLIB_LOCALEDIR.
* glib/gutils.c: Use them for GLIB_LOCALE_DIR.
* glib/gwin32.c (get_package_directory_from_module): Plug a small
memory leak. Minor code reordering.

View File

@ -1,3 +1,12 @@
2001-10-23 Tor Lillqvist <tml@iki.fi>
* glib/gutils.h: Remove G_HARDCODED_PATH_WRAPPER, Owen didn't like
it.
* glib/gutils.c: Instead, expand it on Win32 as
_glib_get_locale_dir(), and #define GLIB_LOCALE_DIR as a call to
it.
2001-10-23 Tor Lillqvist <tml@iki.fi>
* config.h.win32.in: Typo.
@ -13,7 +22,7 @@
G_HARDCODED_PATH_WRAPPER. These are used to avoid hardcoding path
names into Windows DLLs.
* glib/gutils.c: Use them for GLIB_LOCALEDIR.
* glib/gutils.c: Use them for GLIB_LOCALE_DIR.
* glib/gwin32.c (get_package_directory_from_module): Plug a small
memory leak. Minor code reordering.

View File

@ -1,3 +1,12 @@
2001-10-23 Tor Lillqvist <tml@iki.fi>
* glib/gutils.h: Remove G_HARDCODED_PATH_WRAPPER, Owen didn't like
it.
* glib/gutils.c: Instead, expand it on Win32 as
_glib_get_locale_dir(), and #define GLIB_LOCALE_DIR as a call to
it.
2001-10-23 Tor Lillqvist <tml@iki.fi>
* config.h.win32.in: Typo.
@ -13,7 +22,7 @@
G_HARDCODED_PATH_WRAPPER. These are used to avoid hardcoding path
names into Windows DLLs.
* glib/gutils.c: Use them for GLIB_LOCALEDIR.
* glib/gutils.c: Use them for GLIB_LOCALE_DIR.
* glib/gwin32.c (get_package_directory_from_module): Plug a small
memory leak. Minor code reordering.

View File

@ -1,3 +1,12 @@
2001-10-23 Tor Lillqvist <tml@iki.fi>
* glib/gutils.h: Remove G_HARDCODED_PATH_WRAPPER, Owen didn't like
it.
* glib/gutils.c: Instead, expand it on Win32 as
_glib_get_locale_dir(), and #define GLIB_LOCALE_DIR as a call to
it.
2001-10-23 Tor Lillqvist <tml@iki.fi>
* config.h.win32.in: Typo.
@ -13,7 +22,7 @@
G_HARDCODED_PATH_WRAPPER. These are used to avoid hardcoding path
names into Windows DLLs.
* glib/gutils.c: Use them for GLIB_LOCALEDIR.
* glib/gutils.c: Use them for GLIB_LOCALE_DIR.
* glib/gwin32.c (get_package_directory_from_module): Plug a small
memory leak. Minor code reordering.

View File

@ -1,3 +1,12 @@
2001-10-23 Tor Lillqvist <tml@iki.fi>
* glib/gutils.h: Remove G_HARDCODED_PATH_WRAPPER, Owen didn't like
it.
* glib/gutils.c: Instead, expand it on Win32 as
_glib_get_locale_dir(), and #define GLIB_LOCALE_DIR as a call to
it.
2001-10-23 Tor Lillqvist <tml@iki.fi>
* config.h.win32.in: Typo.
@ -13,7 +22,7 @@
G_HARDCODED_PATH_WRAPPER. These are used to avoid hardcoding path
names into Windows DLLs.
* glib/gutils.c: Use them for GLIB_LOCALEDIR.
* glib/gutils.c: Use them for GLIB_LOCALE_DIR.
* glib/gwin32.c (get_package_directory_from_module): Plug a small
memory leak. Minor code reordering.

View File

@ -1,3 +1,12 @@
2001-10-23 Tor Lillqvist <tml@iki.fi>
* glib/gutils.h: Remove G_HARDCODED_PATH_WRAPPER, Owen didn't like
it.
* glib/gutils.c: Instead, expand it on Win32 as
_glib_get_locale_dir(), and #define GLIB_LOCALE_DIR as a call to
it.
2001-10-23 Tor Lillqvist <tml@iki.fi>
* config.h.win32.in: Typo.
@ -13,7 +22,7 @@
G_HARDCODED_PATH_WRAPPER. These are used to avoid hardcoding path
names into Windows DLLs.
* glib/gutils.c: Use them for GLIB_LOCALEDIR.
* glib/gutils.c: Use them for GLIB_LOCALE_DIR.
* glib/gwin32.c (get_package_directory_from_module): Plug a small
memory leak. Minor code reordering.

View File

@ -1,3 +1,12 @@
2001-10-23 Tor Lillqvist <tml@iki.fi>
* glib/gutils.h: Remove G_HARDCODED_PATH_WRAPPER, Owen didn't like
it.
* glib/gutils.c: Instead, expand it on Win32 as
_glib_get_locale_dir(), and #define GLIB_LOCALE_DIR as a call to
it.
2001-10-23 Tor Lillqvist <tml@iki.fi>
* config.h.win32.in: Typo.
@ -13,7 +22,7 @@
G_HARDCODED_PATH_WRAPPER. These are used to avoid hardcoding path
names into Windows DLLs.
* glib/gutils.c: Use them for GLIB_LOCALEDIR.
* glib/gutils.c: Use them for GLIB_LOCALE_DIR.
* glib/gwin32.c (get_package_directory_from_module): Plug a small
memory leak. Minor code reordering.

View File

@ -1,3 +1,12 @@
2001-10-23 Tor Lillqvist <tml@iki.fi>
* glib/gutils.h: Remove G_HARDCODED_PATH_WRAPPER, Owen didn't like
it.
* glib/gutils.c: Instead, expand it on Win32 as
_glib_get_locale_dir(), and #define GLIB_LOCALE_DIR as a call to
it.
2001-10-23 Tor Lillqvist <tml@iki.fi>
* config.h.win32.in: Typo.
@ -13,7 +22,7 @@
G_HARDCODED_PATH_WRAPPER. These are used to avoid hardcoding path
names into Windows DLLs.
* glib/gutils.c: Use them for GLIB_LOCALEDIR.
* glib/gutils.c: Use them for GLIB_LOCALE_DIR.
* glib/gwin32.c (get_package_directory_from_module): Plug a small
memory leak. Minor code reordering.

View File

@ -1093,8 +1093,25 @@ g_get_codeset (void)
#include <libintl.h>
#ifdef G_PLATFORM_WIN32
G_WIN32_DLLMAIN_FOR_DLL_NAME (static, dll_name)
G_HARDCODED_PATH_WRAPPER (GLIB_LOCALE_DIR, GETTEXT_PACKAGE, _glib_get_locale_dir, dll_name, "lib/locale")
static const gchar *
_glib_get_locale_dir (void)
{
static const gchar *cache = NULL;
if (cache == NULL)
cache = g_win32_get_package_installation_subdirectory
(GETTEXT_PACKAGE, dll_name, "lib\\locale");
return cache;
}
#undef GLIB_LOCALE_DIR
#define GLIB_LOCALE_DIR _glib_get_locale_dir ()
#endif /* G_PLATFORM_WIN32 */
G_CONST_RETURN gchar *
_glib_gettext (const gchar *str)
@ -1103,7 +1120,7 @@ _glib_gettext (const gchar *str)
if (!_glib_gettext_initialized)
{
bindtextdomain(GETTEXT_PACKAGE, _glib_get_locale_dir ());
bindtextdomain(GETTEXT_PACKAGE, GLIB_LOCALE_DIR);
_glib_gettext_initialized = TRUE;
}

View File

@ -365,47 +365,4 @@ DllMain (HINSTANCE hinstDLL, \
}
#endif /* G_PLATFORM_WIN32 */
/*
* Expands to a function called FUNCTION that on non-Windows
* returns HARDCODED_VALUE. On Windows, deduce a pathname from
* the MODULE_NAME, PACKAGE and SUBDIR. If the code being compiled
* goes into a DLL, MODULE_NAME should be the dll_name passed to
* G_WIN32_DLLMAIN_FOR_DLL_NAME. If the code is for a .EXE, use NULL.
*
* An example: Wherever you would be tempted to write the name of a
* compile-time path macro, like FOOBAR_LIBDIR, instead use
* _get_foobar_libdir(). This requires you to insert in one place in
* your code something like this:
G_WIN32_DLLMAIN_FOR_DLL_NAME(static, dll_name)
G_HARDCODED_PATH_WRAPPER(FOOBAR_LIBDIR, GETTEXT_PACKAGE, _get_foobar_libdir, dll_name, "lib")
* This will on Windows define the DllMain function, and always define
* the _get_foobar_libdir() function. On Windows, this function
* calculates the value corresponding to FOOBAR_LIBDIR at run-time, on
* other systems it returns said constant, as configured before
* compilation.
*/
#ifndef G_PLATFORM_WIN32
# define G_HARDCODED_PATH_WRAPPER(hardcoded_value, package, function, module_name, subdir) \
const gchar * \
function (void) \
{ \
return hardcoded_value; \
}
#else
# define G_HARDCODED_PATH_WRAPPER(hardcoded_value, package, function, module_name, subdir) \
const gchar * \
function (void) \
{ \
static char *cache = NULL; \
if (cache == NULL) \
cache = g_win32_get_package_installation_subdirectory \
(package, module_name, subdir); \
\
return cache; \
}
#endif
#endif /* __G_UTILS_H__ */