From: Tor Lillqvist Date: Thu, 8 Jun 2006 15:24:10 +0000 (+0000) Subject: Workaround for bug in strxfrm() in Microsoft's newer C runtimes. (#343919, X-Git-Tag: GLIB_2_11_3~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c795837524011471eb3a1287994720205678da3a;p=platform%2Fupstream%2Fglib.git Workaround for bug in strxfrm() in Microsoft's newer C runtimes. (#343919, 2006-06-08 Tor Lillqvist * glib/gunicollate.c (msc_strxfrm_wrapper): Workaround for bug in strxfrm() in Microsoft's newer C runtimes. (#343919, Kazuki Iwamoto) --- diff --git a/ChangeLog b/ChangeLog index 9b8bcfc..b331530 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2006-06-08 Tor Lillqvist + + * glib/gunicollate.c (msc_strxfrm_wrapper): Workaround for bug in + strxfrm() in Microsoft's newer C runtimes. (#343919, Kazuki + Iwamoto) + 2006-06-05 Matthias Clasen * configure.in: Bump version diff --git a/ChangeLog.pre-2-12 b/ChangeLog.pre-2-12 index 9b8bcfc..b331530 100644 --- a/ChangeLog.pre-2-12 +++ b/ChangeLog.pre-2-12 @@ -1,3 +1,9 @@ +2006-06-08 Tor Lillqvist + + * glib/gunicollate.c (msc_strxfrm_wrapper): Workaround for bug in + strxfrm() in Microsoft's newer C runtimes. (#343919, Kazuki + Iwamoto) + 2006-06-05 Matthias Clasen * configure.in: Bump version diff --git a/glib/gunicollate.c b/glib/gunicollate.c index b702a63..13a8ed5 100644 --- a/glib/gunicollate.c +++ b/glib/gunicollate.c @@ -30,6 +30,24 @@ #include "gunicodeprivate.h" #include "galias.h" +#ifdef _MSC_VER +/* Workaround for bug in MSVCR80.DLL */ +static size_t +msc_strxfrm_wrapper (char *string1, + const char *string2, + size_t count) +{ + if (!string1 || count <= 0) + { + char tmp; + + return strxfrm (&tmp, string2, 1); + } + return strxfrm (string1, string2, count); +} +#define strxfrm msc_strxfrm_wrapper +#endif + /** * g_utf8_collate: * @str1: a UTF-8 encoded string