0007-strerror.patch 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. Fix compile error
  2. CCLD vlc
  3. /home/br/br3/output/build/vlc-2.2.1/src/.libs/libvlccore.so: undefined reference to `strerror_l'
  4. Code for #else condition was taken from
  5. http://patches.osdyson.org/patch/series/view/vlc/2.2.0~rc2-1+dyson2/dyson.patch
  6. Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
  7. diff -uNr vlc-2.2.1.org/configure.ac vlc-2.2.1/configure.ac
  8. --- vlc-2.2.1.org/configure.ac 2015-04-13 09:57:54.000000000 +0200
  9. +++ vlc-2.2.1/configure.ac 2015-05-02 16:13:22.800448380 +0200
  10. @@ -534,7 +534,7 @@
  11. dnl Check for usual libc functions
  12. AC_CHECK_DECLS([nanosleep],,,[#include <time.h>])
  13. -AC_CHECK_FUNCS([daemon fcntl fstatvfs fork getenv getpwuid_r isatty lstat memalign mmap open_memstream openat pread posix_fadvise posix_madvise setlocale stricmp strnicmp strptime uselocale])
  14. +AC_CHECK_FUNCS([daemon fcntl fstatvfs fork getenv getpwuid_r isatty lstat memalign mmap open_memstream openat pread posix_fadvise posix_madvise setlocale strerror_l stricmp strnicmp strptime uselocale])
  15. AC_REPLACE_FUNCS([atof atoll dirfd fdopendir flockfile fsync getdelim getpid gmtime_r lldiv localtime_r nrand48 poll posix_memalign rewind setenv strcasecmp strcasestr strdup strlcpy strndup strnlen strsep strtof strtok_r strtoll swab tdestroy strverscmp])
  16. AC_CHECK_FUNCS(fdatasync,,
  17. [AC_DEFINE(fdatasync, fsync, [Alias fdatasync() to fsync() if missing.])
  18. diff -uNr vlc-2.2.1.org/src/posix/error.c vlc-2.2.1/src/posix/error.c
  19. --- vlc-2.2.1.org/src/posix/error.c 2014-08-14 09:20:04.000000000 +0200
  20. +++ vlc-2.2.1/src/posix/error.c 2015-05-02 16:25:24.075378369 +0200
  21. @@ -31,6 +31,7 @@
  22. static const char *vlc_strerror_l(int errnum, const char *lname)
  23. {
  24. +#ifdef HAVE_STRERROR_L
  25. int saved_errno = errno;
  26. locale_t loc = newlocale(LC_MESSAGES_MASK, lname, (locale_t)0);
  27. @@ -51,6 +52,9 @@
  28. const char *buf = strerror_l(errnum, loc);
  29. freelocale(loc);
  30. +#else
  31. + const char *buf = strerror(errnum);
  32. +#endif
  33. return buf;
  34. }