[vlc-devel] [PATCH 2/2] android/thread: fix compilation
Zhao Zhili
quinkblack at foxmail.com
Tue Nov 5 17:44:55 CET 2019
strerror_r can be GNU-specific on Android.
---
src/android/thread.c | 17 +----------------
1 file changed, 1 insertion(+), 16 deletions(-)
diff --git a/src/android/thread.c b/src/android/thread.c
index 0cce89e749..0d9191592e 100644
--- a/src/android/thread.c
+++ b/src/android/thread.c
@@ -49,22 +49,7 @@ static void
vlc_thread_fatal_print (const char *action, int error,
const char *function, const char *file, unsigned line)
{
- char buf[1000];
- const char *msg;
-
- switch (strerror_r (error, buf, sizeof (buf)))
- {
- case 0:
- msg = buf;
- break;
- case ERANGE: /* should never happen */
- msg = "unknown (too big to display)";
- break;
- default:
- msg = "unknown (invalid error number)";
- break;
- }
-
+ const char *msg = vlc_strerror_c(error);
fprintf(stderr, "LibVLC fatal error %s (%d) in thread %lu "
"at %s:%u in %s\n Error message: %s\n",
action, error, vlc_thread_id (), file, line, function, msg);
--
2.23.0
More information about the vlc-devel
mailing list