[vlc-devel] [PATCH] Android: fix compilation

Edward Wang edward.c.wang at compdigitec.com
Thu Jan 2 23:17:58 CET 2014


Android does not have strerror_l().

On Android, this localization is not required as these messages will never be displayed.
---
 src/Makefile.am   | 1 +
 src/posix/error.c | 7 ++++++-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/Makefile.am b/src/Makefile.am
index aeff20a..d247d29 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -259,6 +259,7 @@ SOURCES_libvlc_darwin = \
 SOURCES_libvlc_android = \
 	android/dirs.c \
 	android/thread.c \
+	posix/error.c \
 	posix/filesystem.c \
 	android/netconf.c \
 	posix/plugin.c \
diff --git a/src/posix/error.c b/src/posix/error.c
index acb42c9..62d29be 100644
--- a/src/posix/error.c
+++ b/src/posix/error.c
@@ -30,7 +30,12 @@
 static const char *vlc_strerror_l(int errnum, const char *lname)
 {
     locale_t loc = newlocale(LC_MESSAGES_MASK, lname, (locale_t)0);
-    const char *buf = strerror_l(errnum, loc);
+    const char *buf;
+#ifndef __ANDROID__
+    buf = strerror_l(errnum, loc);
+#else
+    buf = strerror(errnum);
+#endif
 
     freelocale(loc);
     return buf;
-- 
1.8.5.2




More information about the vlc-devel mailing list