Browse Source

configure: test for newlocale() separate from uselocale()

As NetBSD only implements a barely sensical subset of the locale_t API.

(cherry picked from commit 192c77e42d)
Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>

Conflicts:
	configure.ac
pull/135/head
Rémi Denis-Courmont 9 years ago
parent
commit
4a90f3313f
  1. 2
      configure.ac
  2. 24
      include/vlc_fixups.h

2
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,,

24
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 <locale.h>
# endif
static inline locale_t uselocale(locale_t loc)
{
(void)loc;
return NULL;
}
#endif
#if !defined (HAVE_STATIC_ASSERT) && !defined(__cpp_static_assert)

Loading…
Cancel
Save