1*4882a593SmuzhiyunFrom 0435cf37308652af1cf244b6429e919fa7ffaa95 Mon Sep 17 00:00:00 2001 2*4882a593SmuzhiyunFrom: Bernd Kuhls <bernd.kuhls@t-online.de> 3*4882a593SmuzhiyunDate: Tue, 1 May 2018 22:31:23 +0200 4*4882a593SmuzhiyunSubject: [PATCH] Don't assume strerror_l() is available 5*4882a593Smuzhiyun 6*4882a593SmuzhiyunFix compile error 7*4882a593Smuzhiyun 8*4882a593Smuzhiyun CCLD vlc 9*4882a593Smuzhiyun/home/br/br3/output/build/vlc-2.2.1/src/.libs/libvlccore.so: undefined reference to `strerror_l' 10*4882a593Smuzhiyun 11*4882a593SmuzhiyunCode for #else condition was taken from 12*4882a593Smuzhiyunhttp://patches.osdyson.org/patch/series/view/vlc/2.2.0~rc2-1+dyson2/dyson.patch 13*4882a593Smuzhiyun 14*4882a593Smuzhiyun[Bernd: rebased for vlc-3.0.6 & 3.0.9.2] 15*4882a593SmuzhiyunSigned-off-by: Bernd Kuhls <bernd.kuhls@t-online.de> 16*4882a593Smuzhiyun--- 17*4882a593Smuzhiyun configure.ac | 2 +- 18*4882a593Smuzhiyun src/posix/error.c | 4 ++++ 19*4882a593Smuzhiyun 2 files changed, 5 insertions(+), 1 deletion(-) 20*4882a593Smuzhiyun 21*4882a593Smuzhiyundiff --git a/configure.ac b/configure.ac 22*4882a593Smuzhiyunindex dfb4c1c329..bfe43512a2 100644 23*4882a593Smuzhiyun--- a/configure.ac 24*4882a593Smuzhiyun+++ b/configure.ac 25*4882a593Smuzhiyun@@ -590,7 +590,7 @@ dnl Check for system libs needed 26*4882a593Smuzhiyun need_libc=false 27*4882a593Smuzhiyun 28*4882a593Smuzhiyun dnl Check for usual libc functions 29*4882a593Smuzhiyun-AC_CHECK_FUNCS([accept4 daemon fcntl flock fstatvfs fork getenv getmntent_r getpwuid_r isatty lstat memalign mkostemp mmap newlocale open_memstream openat pipe2 pread posix_fadvise posix_madvise posix_memalign setlocale stricmp strnicmp strptime uselocale]) 30*4882a593Smuzhiyun+AC_CHECK_FUNCS([accept4 daemon fcntl flock fstatvfs fork getenv getmntent_r getpwuid_r isatty lstat memalign mkostemp mmap newlocale open_memstream openat pipe2 pread posix_fadvise posix_madvise posix_memalign setlocale strerror_l stricmp strnicmp strptime uselocale]) 31*4882a593Smuzhiyun AC_REPLACE_FUNCS([aligned_alloc atof atoll dirfd fdopendir ffsll flockfile fsync getdelim getpid lfind lldiv memrchr nrand48 poll recvmsg rewind sendmsg setenv strcasecmp strcasestr strdup strlcpy strndup strnlen strnstr strsep strtof strtok_r strtoll swab tdestroy tfind timegm timespec_get strverscmp pathconf]) 32*4882a593Smuzhiyun AC_REPLACE_FUNCS([gettimeofday]) 33*4882a593Smuzhiyun AC_CHECK_FUNC(fdatasync,, 34*4882a593Smuzhiyundiff --git a/src/posix/error.c b/src/posix/error.c 35*4882a593Smuzhiyunindex db51004601..b4aa6fb3ca 100644 36*4882a593Smuzhiyun--- a/src/posix/error.c 37*4882a593Smuzhiyun+++ b/src/posix/error.c 38*4882a593Smuzhiyun@@ -31,6 +31,7 @@ 39*4882a593Smuzhiyun 40*4882a593Smuzhiyun static const char *vlc_strerror_l(int errnum, const char *lname) 41*4882a593Smuzhiyun { 42*4882a593Smuzhiyun+#ifdef HAVE_STRERROR_L 43*4882a593Smuzhiyun int saved_errno = errno; 44*4882a593Smuzhiyun locale_t loc = newlocale(LC_MESSAGES_MASK, lname, (locale_t)0); 45*4882a593Smuzhiyun 46*4882a593Smuzhiyun@@ -51,6 +52,9 @@ static const char *vlc_strerror_l(int errnum, const char *lname) 47*4882a593Smuzhiyun const char *buf = strerror_l(errnum, loc); 48*4882a593Smuzhiyun 49*4882a593Smuzhiyun freelocale(loc); 50*4882a593Smuzhiyun+#else 51*4882a593Smuzhiyun+ const char *buf = strerror(errnum); 52*4882a593Smuzhiyun+#endif 53*4882a593Smuzhiyun return buf; 54*4882a593Smuzhiyun } 55*4882a593Smuzhiyun 56*4882a593Smuzhiyun-- 57*4882a593Smuzhiyun2.14.4 58*4882a593Smuzhiyun 59