diff options
author | Christoph Reiter <creiter@src.gnome.org> | 2017-03-28 08:03:14 +0200 |
---|---|---|
committer | Christoph Reiter <creiter@src.gnome.org> | 2017-04-06 19:25:09 +0200 |
commit | 5067d25a74783a8b6eee68bb83b47ade004d39bc (patch) | |
tree | 169381653e25b1e5395e80db061ed7b72f286058 /glib/gwin32.c | |
parent | 23dffdd949eb1cde6900d0ddc1f543261401fdbd (diff) | |
download | glib-5067d25a74783a8b6eee68bb83b47ade004d39bc.tar.gz |
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
Diffstat (limited to 'glib/gwin32.c')
-rw-r--r-- | glib/gwin32.c | 104 |
1 files changed, 41 insertions, 63 deletions
diff --git a/glib/gwin32.c b/glib/gwin32.c index 81aab00a1..2fa6f2621 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 |