[glib] gwin32: Remove old win32 codepage ABI compat code



commit 5067d25a74783a8b6eee68bb83b47ade004d39bc
Author: Christoph Reiter <creiter src gnome org>
Date:   Tue Mar 28 08:03:14 2017 +0200

    gwin32: Remove old win32 codepage ABI compat code
    
    Makes new code link against the normal symbol names again.
    Variants with utf8 suffix are there for existing binaries/ABI compat.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=780634

 glib/gwin32.c |  104 ++++++++++++++++++++++----------------------------------
 glib/gwin32.h |   17 ---------
 2 files changed, 41 insertions(+), 80 deletions(-)
---
diff --git a/glib/gwin32.c b/glib/gwin32.c
index 81aab00..2fa6f26 100644
--- a/glib/gwin32.c
+++ b/glib/gwin32.c
@@ -412,9 +412,9 @@ get_package_directory_from_module (const gchar *module_name)
  * g_win32_get_package_installation_directory_of_module() instead.
  **/
 
- gchar *
-g_win32_get_package_installation_directory_utf8 (const gchar *package,
-                                                const gchar *dll_name)
+gchar *
+g_win32_get_package_installation_directory (const gchar *package,
+                                            const gchar *dll_name)
 {
   gchar *result = NULL;
 
@@ -430,38 +430,6 @@ g_win32_get_package_installation_directory_utf8 (const gchar *package,
   return result;
 }
 
-#if !defined (_WIN64)
-
-/* DLL ABI binary compatibility version that uses system codepage file names */
-
-gchar *
-g_win32_get_package_installation_directory (const gchar *package,
-                                           const gchar *dll_name)
-{
-  gchar *utf8_package = NULL, *utf8_dll_name = NULL;
-  gchar *utf8_retval, *retval;
-
-  if (package != NULL)
-    utf8_package = g_locale_to_utf8 (package, -1, NULL, NULL, NULL);
-
-  if (dll_name != NULL)
-    utf8_dll_name = g_locale_to_utf8 (dll_name, -1, NULL, NULL, NULL);
-
-  utf8_retval =
-    g_win32_get_package_installation_directory_utf8 (utf8_package,
-                                                    utf8_dll_name);
-
-  retval = g_locale_from_utf8 (utf8_retval, -1, NULL, NULL, NULL);
-
-  g_free (utf8_package);
-  g_free (utf8_dll_name);
-  g_free (utf8_retval);
-
-  return retval;
-}
-
-#endif
-
 /**
  * g_win32_get_package_installation_subdirectory:
  * @package: (nullable): You should pass %NULL for this.
@@ -492,38 +460,16 @@ g_win32_get_package_installation_directory (const gchar *package,
  **/
 
 gchar *
-g_win32_get_package_installation_subdirectory_utf8 (const gchar *package,
-                                                   const gchar *dll_name,
-                                                   const gchar *subdir)
-{
-  gchar *prefix;
-  gchar *dirname;
-
-G_GNUC_BEGIN_IGNORE_DEPRECATIONS
-  prefix = g_win32_get_package_installation_directory_utf8 (package, dll_name);
-G_GNUC_END_IGNORE_DEPRECATIONS
-
-  dirname = g_build_filename (prefix, subdir, NULL);
-  g_free (prefix);
-
-  return dirname;
-}
-
-#if !defined (_WIN64)
-
-/* DLL ABI binary compatibility version that uses system codepage file names */
-
-gchar *
 g_win32_get_package_installation_subdirectory (const gchar *package,
-                                              const gchar *dll_name,
-                                              const gchar *subdir)
+                                               const gchar *dll_name,
+                                               const gchar *subdir)
 {
   gchar *prefix;
   gchar *dirname;
 
-  G_GNUC_BEGIN_IGNORE_DEPRECATIONS
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
   prefix = g_win32_get_package_installation_directory (package, dll_name);
-  G_GNUC_END_IGNORE_DEPRECATIONS
+G_GNUC_END_IGNORE_DEPRECATIONS
 
   dirname = g_build_filename (prefix, subdir, NULL);
   g_free (prefix);
@@ -531,8 +477,6 @@ g_win32_get_package_installation_subdirectory (const gchar *package,
   return dirname;
 }
 
-#endif
-
 /**
  * g_win32_check_windows_version:
  * @major: major version of Windows
@@ -782,3 +726,37 @@ g_win32_get_command_line (void)
   LocalFree (args);
   return result;
 }
+
+#ifdef G_OS_WIN32
+
+/* Binary compatibility versions. Not for newly compiled code. */
+
+_GLIB_EXTERN gchar *g_win32_get_package_installation_directory_utf8    (const gchar *package,
+                                                                        const gchar *dll_name);
+
+_GLIB_EXTERN gchar *g_win32_get_package_installation_subdirectory_utf8 (const gchar *package,
+                                                                        const gchar *dll_name,
+                                                                        const gchar *subdir);
+
+gchar *
+g_win32_get_package_installation_directory_utf8 (const gchar *package,
+                                                 const gchar *dll_name)
+{
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
+  return g_win32_get_package_installation_directory (package, dll_name);
+G_GNUC_END_IGNORE_DEPRECATIONS
+}
+
+gchar *
+g_win32_get_package_installation_subdirectory_utf8 (const gchar *package,
+                                                    const gchar *dll_name,
+                                                    const gchar *subdir)
+{
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
+  return g_win32_get_package_installation_subdirectory (package,
+                                                        dll_name,
+                                                        subdir);
+G_GNUC_END_IGNORE_DEPRECATIONS
+}
+
+#endif
diff --git a/glib/gwin32.h b/glib/gwin32.h
index ff4a9ca..9905faf 100644
--- a/glib/gwin32.h
+++ b/glib/gwin32.h
@@ -111,23 +111,6 @@ gchar **        g_win32_get_command_line (void);
 #define G_WIN32_IS_NT_BASED() TRUE
 #define G_WIN32_HAVE_WIDECHAR_API() TRUE
 
-#ifndef __GTK_DOC_IGNORE__
-#ifdef G_OS_WIN32
-#ifdef _WIN64
-#define g_win32_get_package_installation_directory g_win32_get_package_installation_directory_utf8
-#define g_win32_get_package_installation_subdirectory g_win32_get_package_installation_subdirectory_utf8
-#endif
-
-GLIB_AVAILABLE_IN_ALL
-gchar *g_win32_get_package_installation_directory_utf8    (const gchar *package,
-                                                           const gchar *dll_name);
-GLIB_AVAILABLE_IN_ALL
-gchar *g_win32_get_package_installation_subdirectory_utf8 (const gchar *package,
-                                                           const gchar *dll_name,
-                                                           const gchar *subdir);
-#endif /* G_OS_WIN32 */
-#endif /* __GTK_DOC_IGNORE__ */
-
 /**
  * GWin32OSType:
  * @G_WIN32_OS_ANY: The running system can be a workstation or a server edition of


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]