mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-20 23:58:54 +02:00
Fix detection and usage of strerror_r()
autoconf provides a macro for this situation, which saves us having to manually work out whether strerror_r() returns a char* or an int. https://bugzilla.gnome.org/show_bug.cgi?id=784000
This commit is contained in:
committed by
Philip Withnall
parent
bb50b70713
commit
c8e268bbce
@@ -1277,10 +1277,10 @@ g_strerror (gint errnum)
|
||||
msg = buf;
|
||||
#elif defined(HAVE_STRERROR_R)
|
||||
/* Match the condition in strerror_r(3) for glibc */
|
||||
# if defined(__GLIBC__) && !((_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600) && ! _GNU_SOURCE)
|
||||
# if defined(STRERROR_R_CHAR_P)
|
||||
msg = strerror_r (errnum, buf, sizeof (buf));
|
||||
# else
|
||||
strerror_r (errnum, buf, sizeof (buf));
|
||||
(void) strerror_r (errnum, buf, sizeof (buf));
|
||||
msg = buf;
|
||||
# endif /* HAVE_STRERROR_R */
|
||||
#else
|
||||
|
Reference in New Issue
Block a user