diff --git a/configure.ac b/configure.ac index 5bf2a0366e..225bcae987 100644 --- a/configure.ac +++ b/configure.ac @@ -590,7 +590,7 @@ dnl Check for system libs needed need_libc=false dnl Check for usual libc functions -AC_CHECK_FUNCS([accept4 daemon fcntl flock fstatvfs fork getenv getpwuid_r isatty lstat memalign mkostemp mmap open_memstream openat pipe2 pread posix_fadvise posix_madvise posix_memalign setlocale stricmp strnicmp strptime uselocale]) +AC_CHECK_FUNCS([accept4 daemon fcntl flock fstatvfs fork getenv getpwuid_r isatty lstat memalign mkostemp mmap newlocale open_memstream openat pipe2 pread posix_fadvise posix_madvise posix_memalign setlocale stricmp strnicmp strptime uselocale]) AC_REPLACE_FUNCS([aligned_alloc atof atoll dirfd fdopendir ffsll flockfile fsync getdelim getpid 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]) AC_REPLACE_FUNCS([gettimeofday]) AC_CHECK_FUNC(fdatasync,, diff --git a/include/vlc_fixups.h b/include/vlc_fixups.h index f1bcd06ce9..3003a154f6 100644 --- a/include/vlc_fixups.h +++ b/include/vlc_fixups.h @@ -320,16 +320,13 @@ void *aligned_alloc(size_t, size_t); /* locale.h */ #ifndef HAVE_USELOCALE -#define LC_ALL_MASK 0 -#define LC_NUMERIC_MASK 0 -#define LC_MESSAGES_MASK 0 -#define LC_GLOBAL_LOCALE ((locale_t)(uintptr_t)1) +# ifndef HAVE_NEWLOCALE +# define LC_ALL_MASK 0 +# define LC_NUMERIC_MASK 0 +# define LC_MESSAGES_MASK 0 +# define LC_GLOBAL_LOCALE ((locale_t)(uintptr_t)1) typedef void *locale_t; -static inline locale_t uselocale(locale_t loc) -{ - (void)loc; - return NULL; -} + static inline void freelocale(locale_t loc) { (void)loc; @@ -339,6 +336,15 @@ static inline locale_t newlocale(int mask, const char * locale, locale_t base) (void)mask; (void)locale; (void)base; return NULL; } +# else +# include +# endif + +static inline locale_t uselocale(locale_t loc) +{ + (void)loc; + return NULL; +} #endif #if !defined (HAVE_STATIC_ASSERT) && !defined(__cpp_static_assert)