#include <vlc/vlc.h>
#include <stdio.h>
#include <stdlib.h>
-#include <locale.h>
+
+#ifdef HAVE_SETLOCALE
+# include <locale.h>
+#endif
#ifdef HAVE_GETOPT_H
# include <getopt.h>
{ NULL, no_argument, NULL, '\0'}
};
+#ifdef HAVE_SETLOCALE
setlocale (LC_CTYPE, ""); /* needed by FromLocale() */
+#endif
int c;
while ((c = getopt_long (argc, argv, "hV", opts, NULL)) != -1)
need_libc=false
dnl Check for usual libc functions
-AC_CHECK_FUNCS([ctime_r daemon fcntl fdopendir fork getenv getpwuid_r gettimeofday isatty lstat memalign posix_fadvise posix_madvise posix_memalign putenv setenv stricmp strnicmp tdestroy uselocale])
+AC_CHECK_FUNCS([ctime_r daemon fcntl fdopendir fork getenv getpwuid_r gettimeofday isatty lstat memalign posix_fadvise posix_madvise posix_memalign putenv setenv setlocale stricmp strnicmp tdestroy uselocale])
AC_REPLACE_FUNCS([asprintf atof atoll getcwd getpid gmtime_r lldiv localtime_r rewind strcasecmp strcasestr strdup strlcpy strncasecmp strndup strnlen strsep strtof strtok_r strtoll swab vasprintf])
AC_CHECK_FUNCS(fdatasync,,
[AC_DEFINE(fdatasync, fsync, [Alias fdatasync() to fsync() if missing.])