From: Pierre Ynard Date: Tue, 26 Jan 2010 13:35:49 +0000 (+0100) Subject: Use ifdef's to guard against setlocale() in vlc-cache-gen X-Git-Tag: 1.1.0-ff~859 X-Git-Url: https://git.sesse.net/?p=vlc;a=commitdiff_plain;h=54a847e61499d93ba027fa73ec5715aadd96d2f0 Use ifdef's to guard against setlocale() in vlc-cache-gen --- diff --git a/bin/cachegen.c b/bin/cachegen.c index 5792ea1965..17f01a3a1a 100644 --- a/bin/cachegen.c +++ b/bin/cachegen.c @@ -25,7 +25,10 @@ #include #include #include -#include + +#ifdef HAVE_SETLOCALE +# include +#endif #ifdef HAVE_GETOPT_H # include @@ -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) diff --git a/configure.ac b/configure.ac index 0ee70dc146..b40e236727 100644 --- a/configure.ac +++ b/configure.ac @@ -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.])