]> git.sesse.net Git - vlc/commitdiff
Use ifdef's to guard against setlocale() in vlc-cache-gen
authorPierre Ynard <linkfanel@yahoo.fr>
Tue, 26 Jan 2010 13:35:49 +0000 (14:35 +0100)
committerPierre Ynard <linkfanel@yahoo.fr>
Tue, 26 Jan 2010 13:35:49 +0000 (14:35 +0100)
bin/cachegen.c
configure.ac

index 5792ea19658154ed0369b90f237cb3bd0c6f51ca..17f01a3a1a212733041dfe9690fba5004e240f3a 100644 (file)
 #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>
@@ -56,7 +59,9 @@ int main (int argc, char *argv[])
         { 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)
index 0ee70dc146b41a23c1433c0d40306d05436cf067..b40e2367274800639f6f381fa871530f8e0fef5b 100644 (file)
@@ -562,7 +562,7 @@ dnl Check for system libs needed
 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.])