win32: Drop old codepage ABI from gutils.c
authorRyan Lortie <desrt@desrt.ca>
Mon, 4 Feb 2013 13:04:05 +0000 (14:04 +0100)
committerRyan Lortie <desrt@desrt.ca>
Wed, 20 Feb 2013 11:09:29 +0000 (11:09 +0000)
commit8c42a663f8182f8281c083390aa761e8e9badc63
treef2bbe98e1007137b0cc0916d10cf337aa7e6ae54
parentb029135ed49b33d8f301d79a9ca27df6894d8b22
win32: Drop old codepage ABI from gutils.c

This is a source-compatible change and only breaks ABI with respect to
truly ancient binaries (and those binaries are already broken for other
reasons).

Back in the day, functions like g_get_user_name() used to return strings
in the system codepage instead of utf8 (as they do today).

It was decided at some point to change these functions to return utf8,
breaking source compatibility but keeping ABI compatibility.  This was
done by exporting new symbols with names like g_get_user_name_utf8() and
using a #define of the old name over to the new name (so that newly
compiled code would link against the _utf8 version, but old binaries
would continue to use the non-utf8 variant).

Meanwhile, glib has undergone several ABI breaks on Windows since, so
those old binaries don't work anymore.

Start to clean up this mess by removing the #define renaming.  New
binaries calling g_get_user_name() will now link against
g_get_user_name() and it will return utf8.

We must keep the functions like g_get_user_name_utf8() for binary
compatibility with recently built programs (ie: ones built with the
renaming).  Nobody should have ever been calling these directly and of
course they can return utf8, so just add them as internal wrappers in the
.c file and declare them _GLIB_EXTERN there.

One day, if we feel like breaking Windows ABI again, we can finish the
cleanup by dropping the wrappers.  There is some talk of introducing
something like 'ABI compatible for two years' and this change would be
compatible with such a regime.

https://bugzilla.gnome.org/show_bug.cgi?id=693204
glib/gutils.c
glib/gutils.h