Permalink
Browse files

win32: remove old "locale encoded filename parameter" dll abi compati…

…bility exports

All code compiled agains GLib 2.6 uses the utf8() variants.
The dll abi compatibility non-utf8() variants where only provided
with 32-bit builds. Unfortunately, abi has been broken on at
least one location so we are pretty sure binaries compiled agains
a GLib version older than 2.6 will not work with current GLib
binaries at all. So there is no longer a reason to export these
at all.

Make sure code compiled from now on stops using the _utf8 suffixed
versions and alias _utf8 versions so binaries compiled agains GLib 2.6
up until this commit continue working.

As a side-effect, this fixes an introspection bug on win32 where
only the _utf8 versions where available in the typelibs. Meaning
code written on Linux (which never had the _utf8 suffix for these
functions to begin with) didn't work on Windows.

https://bugzilla.gnome.org/show_bug.cgi?id=620566
https://bugzilla.gnome.org/show_bug.cgi?id=673312
  • Loading branch information...
1 parent 3b30bf8 commit 0edaa57bcf87598698a24d3e232c6879970982e8 @dieterv committed Oct 1, 2012
Showing with 147 additions and 1,029 deletions.
  1. +1 −1 gio/Makefile.am
  2. +0 −101 glib/gconvert.c
  3. +0 −9 glib/gconvert.h
  4. +0 −63 glib/gdir.c
  5. +0 −8 glib/gdir.h
  6. +0 −54 glib/genviron.c
  7. +0 −8 glib/genviron.h
  8. +0 −112 glib/gfileutils.c
  9. +0 −15 glib/gfileutils.h
  10. +0 −3 glib/giochannel.h
  11. +0 −26 glib/giowin32.c
  12. +60 −82 glib/glib.symbols
  13. +39 −308 glib/gspawn-win32.c
  14. +0 −10 glib/gspawn.h
  15. +0 −60 glib/gutils.c
  16. +0 −15 glib/gutils.h
  17. +2 −60 glib/gwin32.c
  18. +0 −7 glib/gwin32.h
  19. +1 −1 gmodule/Makefile.am
  20. +37 −72 gmodule/gmodule.c
  21. +0 −7 gmodule/gmodule.h
  22. +6 −6 gmodule/gmodule.symbols
  23. +1 −1 gobject/Makefile.am
View
@@ -24,7 +24,7 @@ uninstall-ms-lib:
$(uninstall_ms_lib_cmd)
gio.def: gio.symbols
- $(AM_V_GEN) (echo EXPORTS; $(CPP) -P -DINCLUDE_VARIABLES -DINCLUDE_INTERNAL_SYMBOLS -DG_OS_WIN32 -DALL_FILES - <$(srcdir)/gio.symbols | sed -e '/^$$/d' -e 's/^/ /' -e 's/G_GNUC_[^ ]*//g' | sort) > $(builddir)/gio.def.tmp && \
+ $(AM_V_GEN) (echo EXPORTS; $(CPP) -P -DG_OS_WIN32 - <$(srcdir)/gio.symbols | sed -e '/^$$/d' -e 's/^/ /' -e 's/G_GNUC_[^ ]*//g' | sort) > $(builddir)/gio.def.tmp && \
mv $(builddir)/gio.def.tmp $(builddir)/gio.def
if OS_LINUX
View
@@ -1460,35 +1460,6 @@ g_filename_to_utf8 (const gchar *opsysstring,
"UTF-8", charset, bytes_read, bytes_written, error);
}
-#if defined (G_OS_WIN32) && !defined (_WIN64)
-
-#undef g_filename_to_utf8
-
-/* Binary compatibility version. Not for newly compiled code. Also not needed for
- * 64-bit versions as there should be no old deployed binaries that would use
- * the old versions.
- */
-
-gchar*
-g_filename_to_utf8 (const gchar *opsysstring,
- gssize len,
- gsize *bytes_read,
- gsize *bytes_written,
- GError **error)
-{
- const gchar *charset;
-
- g_return_val_if_fail (opsysstring != NULL, NULL);
-
- if (g_get_charset (&charset))
- return strdup_len (opsysstring, len, bytes_read, bytes_written, error);
- else
- return g_convert (opsysstring, len,
- "UTF-8", charset, bytes_read, bytes_written, error);
-}
-
-#endif
-
/**
* g_filename_from_utf8:
* @utf8string: a UTF-8 encoded string.
@@ -1531,30 +1502,6 @@ g_filename_from_utf8 (const gchar *utf8string,
charset, "UTF-8", bytes_read, bytes_written, error);
}
-#if defined (G_OS_WIN32) && !defined (_WIN64)
-
-#undef g_filename_from_utf8
-
-/* Binary compatibility version. Not for newly compiled code. */
-
-gchar*
-g_filename_from_utf8 (const gchar *utf8string,
- gssize len,
- gsize *bytes_read,
- gsize *bytes_written,
- GError **error)
-{
- const gchar *charset;
-
- if (g_get_charset (&charset))
- return strdup_len (utf8string, len, bytes_read, bytes_written, error);
- else
- return g_convert (utf8string, len,
- charset, "UTF-8", bytes_read, bytes_written, error);
-}
-
-#endif
-
/* Test of haystack has the needle prefix, comparing case
* insensitive. haystack may be UTF-8, but needle must
* contain only ascii. */
@@ -1966,29 +1913,6 @@ g_filename_from_uri (const gchar *uri,
return result;
}
-#if defined (G_OS_WIN32) && !defined (_WIN64)
-
-#undef g_filename_from_uri
-
-gchar *
-g_filename_from_uri (const gchar *uri,
- gchar **hostname,
- GError **error)
-{
- gchar *utf8_filename;
- gchar *retval = NULL;
-
- utf8_filename = g_filename_from_uri_utf8 (uri, hostname, error);
- if (utf8_filename)
- {
- retval = g_locale_from_utf8 (utf8_filename, -1, NULL, NULL, error);
- g_free (utf8_filename);
- }
- return retval;
-}
-
-#endif
-
/**
* g_filename_to_uri:
* @filename: an absolute filename specified in the GLib file name encoding,
@@ -2041,31 +1965,6 @@ g_filename_to_uri (const gchar *filename,
return escaped_uri;
}
-#if defined (G_OS_WIN32) && !defined (_WIN64)
-
-#undef g_filename_to_uri
-
-gchar *
-g_filename_to_uri (const gchar *filename,
- const gchar *hostname,
- GError **error)
-{
- gchar *utf8_filename;
- gchar *retval = NULL;
-
- utf8_filename = g_locale_to_utf8 (filename, -1, NULL, NULL, error);
-
- if (utf8_filename)
- {
- retval = g_filename_to_uri_utf8 (utf8_filename, hostname, error);
- g_free (utf8_filename);
- }
-
- return retval;
-}
-
-#endif
-
/**
* g_uri_list_extract_uris:
* @uri_list: an URI list
View
@@ -125,15 +125,6 @@ gchar* g_locale_from_utf8 (const gchar *utf8string,
/* Convert between the operating system (or C runtime)
* representation of file names and UTF-8.
*/
-#ifndef __GTK_DOC_IGNORE__
-#ifdef G_OS_WIN32
-#define g_filename_to_utf8 g_filename_to_utf8_utf8
-#define g_filename_from_utf8 g_filename_from_utf8_utf8
-#define g_filename_from_uri g_filename_from_uri_utf8
-#define g_filename_to_uri g_filename_to_uri_utf8
-#endif
-#endif
-
gchar* g_filename_to_utf8 (const gchar *opsysstring,
gssize len,
gsize *bytes_read,
View
@@ -151,36 +151,6 @@ g_dir_open (const gchar *path,
#endif
}
-#if defined (G_OS_WIN32) && !defined (_WIN64)
-
-/* The above function actually is called g_dir_open_utf8, and it's
- * that what applications compiled with this GLib version will
- * use.
- */
-
-#undef g_dir_open
-
-/* Binary compatibility version. Not for newly compiled code. */
-
-GDir *
-g_dir_open (const gchar *path,
- guint flags,
- GError **error)
-{
- gchar *utf8_path = g_locale_to_utf8 (path, -1, NULL, NULL, error);
- GDir *retval;
-
- if (utf8_path == NULL)
- return NULL;
-
- retval = g_dir_open_utf8 (utf8_path, flags, error);
-
- g_free (utf8_path);
-
- return retval;
-}
-#endif
-
/**
* g_dir_read_name:
* @dir: a #GDir* created by g_dir_open()
@@ -252,39 +222,6 @@ g_dir_read_name (GDir *dir)
#endif
}
-#if defined (G_OS_WIN32) && !defined (_WIN64)
-
-/* Ditto for g_dir_read_name */
-
-#undef g_dir_read_name
-
-/* Binary compatibility version. Not for newly compiled code. */
-
-const gchar *
-g_dir_read_name (GDir *dir)
-{
- while (1)
- {
- const gchar *utf8_name = g_dir_read_name_utf8 (dir);
- gchar *retval;
-
- if (utf8_name == NULL)
- return NULL;
-
- retval = g_locale_from_utf8 (utf8_name, -1, NULL, NULL, NULL);
-
- if (retval != NULL)
- {
- strcpy (dir->utf8_buf, retval);
- g_free (retval);
-
- return dir->utf8_buf;
- }
- }
-}
-
-#endif
-
/**
* g_dir_rewind:
* @dir: a #GDir* created by g_dir_open()
View
@@ -34,14 +34,6 @@ G_BEGIN_DECLS
typedef struct _GDir GDir;
-#ifndef __GTK_DOC_IGNORE__
-#ifdef G_OS_WIN32
-/* For DLL ABI stability, keep old names for old (non-UTF-8) functionality. */
-#define g_dir_open g_dir_open_utf8
-#define g_dir_read_name g_dir_read_name_utf8
-#endif
-#endif
-
GDir * g_dir_open (const gchar *path,
guint flags,
GError **error);
View
@@ -653,60 +653,6 @@ g_get_environ (void)
return result;
}
-/* Win32 binary compatibility versions {{{1 */
-#ifndef _WIN64
-
-#undef g_getenv
-
-const gchar *
-g_getenv (const gchar *variable)
-{
- gchar *utf8_variable = g_locale_to_utf8 (variable, -1, NULL, NULL, NULL);
- const gchar *utf8_value = g_getenv_utf8 (utf8_variable);
- gchar *value;
- GQuark quark;
-
- g_free (utf8_variable);
- if (!utf8_value)
- return NULL;
- value = g_locale_from_utf8 (utf8_value, -1, NULL, NULL, NULL);
- quark = g_quark_from_string (value);
- g_free (value);
-
- return g_quark_to_string (quark);
-}
-
-#undef g_setenv
-
-gboolean
-g_setenv (const gchar *variable,
- const gchar *value,
- gboolean overwrite)
-{
- gchar *utf8_variable = g_locale_to_utf8 (variable, -1, NULL, NULL, NULL);
- gchar *utf8_value = g_locale_to_utf8 (value, -1, NULL, NULL, NULL);
- gboolean retval = g_setenv_utf8 (utf8_variable, utf8_value, overwrite);
-
- g_free (utf8_variable);
- g_free (utf8_value);
-
- return retval;
-}
-
-#undef g_unsetenv
-
-void
-g_unsetenv (const gchar *variable)
-{
- gchar *utf8_variable = g_locale_to_utf8 (variable, -1, NULL, NULL, NULL);
-
- g_unsetenv_utf8 (utf8_variable);
-
- g_free (utf8_variable);
-}
-
-#endif /* _WIN64 */
-
#endif /* G_OS_WIN32 */
/* Epilogue {{{1 */
View
@@ -35,14 +35,6 @@
G_BEGIN_DECLS
-#ifndef __GTK_DOC_IGNORE__
-#ifdef G_OS_WIN32
-#define g_getenv g_getenv_utf8
-#define g_setenv g_setenv_utf8
-#define g_unsetenv g_unsetenv_utf8
-#endif
-#endif
-
const gchar * g_getenv (const gchar *variable);
gboolean g_setenv (const gchar *variable,
const gchar *value,
Oops, something went wrong.

0 comments on commit 0edaa57

Please sign in to comment.