Use only the wide character API here, too.
authorTor Lillqvist <tml@novell.com>
Thu, 28 Dec 2006 15:41:28 +0000 (15:41 +0000)
committerTor Lillqvist <tml@src.gnome.org>
Thu, 28 Dec 2006 15:41:28 +0000 (15:41 +0000)
2006-12-28  Tor Lillqvist  <tml@novell.com>

* glib/gutils.h (G_WIN32_DLLMAIN_FOR_DLL_NAME): Use only the wide
character API here, too.

ChangeLog
glib/gutils.h

index 20fa508acb8301ff2d3db847e04a483eae9fdc70..a2f6445966773391e6a6f67063b4cd7d6889185e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2006-12-28  Tor Lillqvist  <tml@novell.com>
 
+       * glib/gutils.h (G_WIN32_DLLMAIN_FOR_DLL_NAME): Use only the wide
+       character API here, too.
+
        * glib/gslice.c: Make it compile on Win32 without pthreads: Use a
        Win32 critical section instead.
 
index bf7cb90406073d4b5334f0ea093cef9067b49453..6a0ca4784c5f8aad5751edf0d0ab7db8a7312d6a 100644 (file)
@@ -407,25 +407,14 @@ DllMain (HINSTANCE hinstDLL,                                              \
         LPVOID    lpvReserved)                                         \
 {                                                                      \
   wchar_t wcbfr[1000];                                                 \
-  char cpbfr[1000];                                                    \
   char *tem;                                                           \
   switch (fdwReason)                                                   \
     {                                                                  \
     case DLL_PROCESS_ATTACH:                                           \
-      if (GetVersion () < 0x80000000)                                  \
-       {                                                               \
-         GetModuleFileNameW ((HMODULE) hinstDLL, wcbfr, G_N_ELEMENTS (wcbfr)); \
-         tem = g_utf16_to_utf8 (wcbfr, -1, NULL, NULL, NULL);          \
-         dll_name = g_path_get_basename (tem);                         \
-         g_free (tem);                                                 \
-       }                                                               \
-      else                                                             \
-       {                                                               \
-         GetModuleFileNameA ((HMODULE) hinstDLL, cpbfr, G_N_ELEMENTS (cpbfr)); \
-         tem = g_locale_to_utf8 (cpbfr, -1, NULL, NULL, NULL);         \
-         dll_name = g_path_get_basename (tem);                         \
-         g_free (tem);                                                 \
-       }                                                               \
+      GetModuleFileNameW ((HMODULE) hinstDLL, wcbfr, G_N_ELEMENTS (wcbfr)); \
+      tem = g_utf16_to_utf8 (wcbfr, -1, NULL, NULL, NULL);             \
+      dll_name = g_path_get_basename (tem);                            \
+      g_free (tem);                                                    \
       break;                                                           \
     }                                                                  \
                                                                        \