Remove G_HARDCODED_PATH_WRAPPER, Owen didn't like it.
authorTor Lillqvist <tml@iki.fi>
Tue, 23 Oct 2001 09:26:54 +0000 (09:26 +0000)
committerTor Lillqvist <tml@src.gnome.org>
Tue, 23 Oct 2001 09:26:54 +0000 (09:26 +0000)
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.

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/gutils.c
glib/gutils.h

index 59ac36c..97471e7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
 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.
 
        * glibconfig.h.win32.in: Minor update to correspond to what
@@ -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.
index 59ac36c..97471e7 100644 (file)
@@ -1,5 +1,14 @@
 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.
 
        * glibconfig.h.win32.in: Minor update to correspond to what
@@ -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.
index 59ac36c..97471e7 100644 (file)
@@ -1,5 +1,14 @@
 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.
 
        * glibconfig.h.win32.in: Minor update to correspond to what
@@ -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.
index 59ac36c..97471e7 100644 (file)
@@ -1,5 +1,14 @@
 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.
 
        * glibconfig.h.win32.in: Minor update to correspond to what
@@ -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.
index 59ac36c..97471e7 100644 (file)
@@ -1,5 +1,14 @@
 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.
 
        * glibconfig.h.win32.in: Minor update to correspond to what
@@ -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.
index 59ac36c..97471e7 100644 (file)
@@ -1,5 +1,14 @@
 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.
 
        * glibconfig.h.win32.in: Minor update to correspond to what
@@ -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.
index 59ac36c..97471e7 100644 (file)
@@ -1,5 +1,14 @@
 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.
 
        * glibconfig.h.win32.in: Minor update to correspond to what
@@ -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.
index 59ac36c..97471e7 100644 (file)
@@ -1,5 +1,14 @@
 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.
 
        * glibconfig.h.win32.in: Minor update to correspond to what
@@ -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.
index 7fb0007..6727181 100644 (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;
     }
   
index e8dce6f..5a69a26 100644 (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__ */