mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-11 11:44:03 +02:00
glib/strfuncs.c: Fix Build on Windows
Windows does not have strerror_r(), but does have strerror_s(), which is threadsafe, and does more or less the same thing, so use it on Windows to fix the build. https://bugzilla.gnome.org/show_bug.cgi?id=754431
This commit is contained in:
@@ -1261,7 +1261,12 @@ g_strerror (gint errnum)
|
|||||||
/* Since we are building with _GNU_SOURCE, we get the
|
/* Since we are building with _GNU_SOURCE, we get the
|
||||||
* GNU variant of strerror_r (with glibc).
|
* GNU variant of strerror_r (with glibc).
|
||||||
*/
|
*/
|
||||||
|
#ifdef G_OS_WIN32
|
||||||
|
strerror_s (buf, sizeof (buf), errnum);
|
||||||
|
msg = buf;
|
||||||
|
#else
|
||||||
msg = strerror_r (errnum, buf, sizeof (buf));
|
msg = strerror_r (errnum, buf, sizeof (buf));
|
||||||
|
#endif
|
||||||
if (!g_get_charset (NULL))
|
if (!g_get_charset (NULL))
|
||||||
{
|
{
|
||||||
msg = tofree = g_locale_to_utf8 (msg, -1, NULL, NULL, &error);
|
msg = tofree = g_locale_to_utf8 (msg, -1, NULL, NULL, &error);
|
||||||
|
Reference in New Issue
Block a user