mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-10 11:26:16 +01: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:
parent
4a09d0cf7a
commit
4cad3f5e1b
@ -1261,7 +1261,12 @@ g_strerror (gint errnum)
|
||||
/* Since we are building with _GNU_SOURCE, we get the
|
||||
* 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));
|
||||
#endif
|
||||
if (!g_get_charset (NULL))
|
||||
{
|
||||
msg = tofree = g_locale_to_utf8 (msg, -1, NULL, NULL, &error);
|
||||
|
Loading…
Reference in New Issue
Block a user