From fad5f5bd17f2227373b8a511875be5ece172d43c Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Tue, 28 Mar 2017 08:02:29 +0200 Subject: [PATCH] giochannel: 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/giochannel.h | 11 ----------- glib/giowin32.c | 44 ++++++++++++++++++-------------------------- 2 files changed, 18 insertions(+), 37 deletions(-) diff --git a/glib/giochannel.h b/glib/giochannel.h index 3b6c09a59..cb55c04e8 100644 --- a/glib/giochannel.h +++ b/glib/giochannel.h @@ -399,17 +399,6 @@ void g_io_channel_win32_set_debug (GIOChannel *channel, #endif -#ifndef __GTK_DOC_IGNORE__ -#ifdef G_OS_WIN32 -#define g_io_channel_new_file g_io_channel_new_file_utf8 - -GLIB_AVAILABLE_IN_ALL -GIOChannel *g_io_channel_new_file_utf8 (const gchar *filename, - const gchar *mode, - GError **error); -#endif -#endif /* __GTK_DOC_IGNORE__ */ - G_END_DECLS #endif /* __G_IOCHANNEL_H__ */ diff --git a/glib/giowin32.c b/glib/giowin32.c index 27bb30f8b..e659585dc 100644 --- a/glib/giowin32.c +++ b/glib/giowin32.c @@ -1746,32 +1746,6 @@ g_io_channel_new_file (const gchar *filename, return channel; } -#if !defined (_WIN64) - -#undef g_io_channel_new_file - -/* Binary compatibility version. Not for newly compiled code. */ - -GIOChannel * -g_io_channel_new_file (const gchar *filename, - const gchar *mode, - GError **error) -{ - gchar *utf8_filename = g_locale_to_utf8 (filename, -1, NULL, NULL, error); - GIOChannel *retval; - - if (utf8_filename == NULL) - return NULL; - - retval = g_io_channel_new_file_utf8 (utf8_filename, mode, error); - - g_free (utf8_filename); - - return retval; -} - -#endif - static GIOStatus g_io_win32_unimpl_set_flags (GIOChannel *channel, GIOFlags flags, @@ -2245,3 +2219,21 @@ g_io_channel_win32_new_stream_socket (int socket) } #endif + +#ifdef G_OS_WIN32 + +/* Binary compatibility versions. Not for newly compiled code. */ + +_GLIB_EXTERN GIOChannel *g_io_channel_new_file_utf8 (const gchar *filename, + const gchar *mode, + GError **error); + +GIOChannel * +g_io_channel_new_file_utf8 (const gchar *filename, + const gchar *mode, + GError **error) +{ + return g_io_channel_new_file (filename, mode, error); +} + +#endif -- 2.11.4.GIT