From 5d0cd95de10434edc11634acfd5ce35808428557 Mon Sep 17 00:00:00 2001 From: cristy Date: Thu, 19 May 2011 21:21:41 +0000 Subject: [PATCH] --- config/config.h.in | 9 ++++++--- configure | 2 +- configure.ac | 2 +- magick/locale.c | 10 +++++----- magick/magick-config.h | 11 ++++++++--- magick/nt-base.h | 10 ++++++++++ 6 files changed, 31 insertions(+), 13 deletions(-) diff --git a/config/config.h.in b/config/config.h.in index 6c3cd5ccf..b6e153743 100644 --- a/config/config.h.in +++ b/config/config.h.in @@ -218,9 +218,6 @@ /* Define to 1 if you have the `fork' function. */ #undef HAVE_FORK -/* Define to 1 if you have the `fprintf_l' function. */ -#undef HAVE_FPRINTF_L - /* Define to 1 if fseeko (and presumably ftello) exists and is declared. */ #undef HAVE_FSEEKO @@ -661,6 +658,12 @@ /* Define to 1 if you have the header file. */ #undef HAVE_VFORK_H +/* Define to 1 if you have the `vfprintf' function. */ +#undef HAVE_VFPRINTF + +/* Define to 1 if you have the `vfprintf_l' function. */ +#undef HAVE_VFPRINTF_L + /* Define to 1 if you have the `vprintf' function. */ #undef HAVE_VPRINTF diff --git a/configure b/configure index d9cf6d976..4b68e0890 100755 --- a/configure +++ b/configure @@ -24005,7 +24005,7 @@ fi LIBS="$MATH_LIBS $LIBS" -for ac_func in atoll atexit cabs carg cimag creal clock ctime_r directio _exit execvp fchmod floor fork fprintf_l ftime ftruncate getc_unlocked getcwd getpid getexecname getdtablesize getpagesize getrlimit getrusage gettimeofday gmtime_r j0 j1 lltostr localtime_r lstat memmove memset mkstemp munmap nanosleep newlocale _NSGetExecutablePath pclose _pclose poll popen _popen posix_fadvise posix_fallocate posix_madvise posix_memalign posix_spawnp pow pread pwrite qsort_r raise rand_r readlink readdir_r realpath select seekdir setlocale sqrt setvbuf stat strchr strerror_r strrchr strcspn strdup strpbrk strspn strstr strtod strtod_l strtol strtoul symlink sysconf sigemptyset sigaction spawnvp strerror strlcat strlcpy strcasecmp strncasecmp telldir tempnam times ulltostr uselocale usleep utime vsprintf vsnprintf vsnprintf_l waitpid _wfopen _wstat +for ac_func in atoll atexit cabs carg cimag creal clock ctime_r directio _exit execvp fchmod floor fork ftime ftruncate getc_unlocked getcwd getpid getexecname getdtablesize getpagesize getrlimit getrusage gettimeofday gmtime_r j0 j1 lltostr localtime_r lstat memmove memset mkstemp munmap nanosleep newlocale _NSGetExecutablePath pclose _pclose poll popen _popen posix_fadvise posix_fallocate posix_madvise posix_memalign posix_spawnp pow pread pwrite qsort_r raise rand_r readlink readdir_r realpath select seekdir setlocale sqrt setvbuf stat strchr strerror_r strrchr strcspn strdup strpbrk strspn strstr strtod strtod_l strtol strtoul symlink sysconf sigemptyset sigaction spawnvp strerror strlcat strlcpy strcasecmp strncasecmp telldir tempnam times ulltostr uselocale usleep utime vfprintf vfprintf_l vsprintf vsnprintf vsnprintf_l waitpid _wfopen _wstat do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" diff --git a/configure.ac b/configure.ac index 7aba68bb5..b058e1485 100755 --- a/configure.ac +++ b/configure.ac @@ -1051,7 +1051,7 @@ AC_CHECK_LIB(m,sqrt,MATH_LIBS="-lm",,) LIBS="$MATH_LIBS $LIBS" AC_SUBST(MATH_LIBS) -AC_CHECK_FUNCS([atoll atexit cabs carg cimag creal clock ctime_r directio _exit execvp fchmod floor fork fprintf_l ftime ftruncate getc_unlocked getcwd getpid getexecname getdtablesize getpagesize getrlimit getrusage gettimeofday gmtime_r j0 j1 lltostr localtime_r lstat memmove memset mkstemp munmap nanosleep newlocale _NSGetExecutablePath pclose _pclose poll popen _popen posix_fadvise posix_fallocate posix_madvise posix_memalign posix_spawnp pow pread pwrite qsort_r raise rand_r readlink readdir_r realpath select seekdir setlocale sqrt setvbuf stat strchr strerror_r strrchr strcspn strdup strpbrk strspn strstr strtod strtod_l strtol strtoul symlink sysconf sigemptyset sigaction spawnvp strerror strlcat strlcpy strcasecmp strncasecmp telldir tempnam times ulltostr uselocale usleep utime vsprintf vsnprintf vsnprintf_l waitpid _wfopen _wstat]) +AC_CHECK_FUNCS([atoll atexit cabs carg cimag creal clock ctime_r directio _exit execvp fchmod floor fork ftime ftruncate getc_unlocked getcwd getpid getexecname getdtablesize getpagesize getrlimit getrusage gettimeofday gmtime_r j0 j1 lltostr localtime_r lstat memmove memset mkstemp munmap nanosleep newlocale _NSGetExecutablePath pclose _pclose poll popen _popen posix_fadvise posix_fallocate posix_madvise posix_memalign posix_spawnp pow pread pwrite qsort_r raise rand_r readlink readdir_r realpath select seekdir setlocale sqrt setvbuf stat strchr strerror_r strrchr strcspn strdup strpbrk strspn strstr strtod strtod_l strtol strtoul symlink sysconf sigemptyset sigaction spawnvp strerror strlcat strlcpy strcasecmp strncasecmp telldir tempnam times ulltostr uselocale usleep utime vfprintf vfprintf_l vsprintf vsnprintf vsnprintf_l waitpid _wfopen _wstat]) # # Check for clock_gettime(). diff --git a/magick/locale.c b/magick/locale.c index cf800d643..6913a9b1e 100644 --- a/magick/locale.c +++ b/magick/locale.c @@ -227,16 +227,16 @@ MagickExport ssize_t FormatLocaleFileList(FILE *file,const char *format, int n; -#if defined(MAGICKCORE_HAVE_FPRINTF_L) +#if defined(MAGICKCORE_HAVE_VFPRINTF_L) { locale_t locale; locale=AcquireCLocale(); if (locale == (locale_t) NULL) - n=fprintf(file,format,operands); + n=vfprintf(file,format,operands); else - n=fprintf_l(file,format,locale,operands); + n=vfprintf_l(file,format,locale,operands); } #else #if defined(MAGICKCORE_HAVE_USELOCALE) @@ -247,11 +247,11 @@ MagickExport ssize_t FormatLocaleFileList(FILE *file,const char *format, locale=AcquireCLocale(); if (locale == (locale_t) NULL) - n=fprintf(file,format,operands); + n=vfprintf(file,format,operands); else { previous_locale=uselocale(locale); - n=fprintf(file,format,operands); + n=vfprintf(file,format,operands); uselocale(previous_locale); } } diff --git a/magick/magick-config.h b/magick/magick-config.h index db6c5c3d5..b8e6cd8fb 100644 --- a/magick/magick-config.h +++ b/magick/magick-config.h @@ -321,9 +321,6 @@ #define MAGICKCORE_HAVE_FORK 1 #endif -/* Define to 1 if you have the `fprintf_l' function. */ -/* #undef HAVE_FPRINTF_L */ - /* Define to 1 if fseeko (and presumably ftello) exists and is declared. */ #ifndef MAGICKCORE_HAVE_FSEEKO #define MAGICKCORE_HAVE_FSEEKO 1 @@ -1008,6 +1005,14 @@ /* Define to 1 if you have the header file. */ /* #undef HAVE_VFORK_H */ +/* Define to 1 if you have the `vfprintf' function. */ +#ifndef MAGICKCORE_HAVE_VFPRINTF +#define MAGICKCORE_HAVE_VFPRINTF 1 +#endif + +/* Define to 1 if you have the `vfprintf_l' function. */ +/* #undef HAVE_VFPRINTF_L */ + /* Define to 1 if you have the `vprintf' function. */ #ifndef MAGICKCORE_HAVE_VPRINTF #define MAGICKCORE_HAVE_VPRINTF 1 diff --git a/magick/nt-base.h b/magick/nt-base.h index cd2d90286..1511bdc4d 100644 --- a/magick/nt-base.h +++ b/magick/nt-base.h @@ -245,6 +245,16 @@ extern "C" { #if !defined(tempnam) # define tempnam _tempnam_s #endif +#if !defined(vfprintf) +#if !defined(_MSC_VER) || (defined(_MSC_VER) && (_MSC_VER < 1500)) +#define vfprintf _vfprintf_s +#endif +#endif +#if !defined(vfprintf_l) +#if !defined(_MSC_VER) || (defined(_MSC_VER) && (_MSC_VER < 1500)) +#define vfprintf_l _vfprintf_s_l +#endif +#endif #if !defined(vsnprintf) #if !defined(_MSC_VER) || (defined(_MSC_VER) && (_MSC_VER < 1500)) #define vsnprintf _vsnprintf_s -- 2.49.0