From: cristy Date: Sun, 17 May 2015 12:49:39 +0000 (+0000) Subject: (no commit message) X-Git-Tag: 7.0.1-0~1028 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c6a82901209d11a186620b6372d8a6b18a552b50;p=imagemagick --- diff --git a/MagickCore/locale.c b/MagickCore/locale.c index d806f7094..76fade021 100644 --- a/MagickCore/locale.c +++ b/MagickCore/locale.c @@ -65,6 +65,9 @@ /* Define declarations. */ +#if defined(MAGICKCORE_HAVE_NEWLOCALE) || defined(MAGICKCORE_WINDOWS_SUPPORT) +# define MAGICKCORE_LOCALE_SUPPORT +#endif #define LocaleFilename "locale.xml" #define MaxRecursionDepth 200 @@ -89,12 +92,10 @@ static SemaphoreInfo static SplayTreeInfo *locale_cache = (SplayTreeInfo *) NULL; -#if !defined(MAGICKCORE_HAVE_LOCALE_T) -typedef void *locale_t; -#endif - +#if defined(MAGICKCORE_LOCALE_SUPPORT) static volatile locale_t c_locale = (locale_t) NULL; +#endif /* Forward declarations. @@ -104,7 +105,7 @@ static MagickBooleanType LoadLocaleCache(SplayTreeInfo *,const char *,const char *,const char *, const size_t,ExceptionInfo *); -#if defined(MAGICKCORE_HAVE_LOCALE_H) +#if defined(MAGICKCORE_LOCALE_SUPPORT) /* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % @@ -234,7 +235,7 @@ static SplayTreeInfo *AcquireLocaleSplayTree(const char *filename, return(locale_cache); } -#if defined(MAGICKCORE_HAVE_LOCALE_H) +#if defined(MAGICKCORE_LOCALE_SUPPORT) /* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % @@ -336,7 +337,7 @@ MagickPrivate ssize_t FormatLocaleFileList(FILE *file, ssize_t n; -#if defined(MAGICKCORE_HAVE_LOCALE_H) && defined(MAGICKCORE_HAVE_VFPRINTF_L) +#if defined(MAGICKCORE_LOCALE_SUPPORT) && defined(MAGICKCORE_HAVE_VFPRINTF_L) { locale_t locale; @@ -352,7 +353,7 @@ MagickPrivate ssize_t FormatLocaleFileList(FILE *file, #endif } #else -#if defined(MAGICKCORE_HAVE_LOCALE_H) && defined(MAGICKCORE_HAVE_USELOCALE) +#if defined(MAGICKCORE_LOCALE_SUPPORT) && defined(MAGICKCORE_HAVE_USELOCALE) { locale_t locale, @@ -427,7 +428,7 @@ MagickPrivate ssize_t FormatLocaleStringList(char *restrict string, ssize_t n; -#if defined(MAGICKCORE_HAVE_LOCALE_H) && defined(MAGICKCORE_HAVE_VSNPRINTF_L) +#if defined(MAGICKCORE_LOCALE_SUPPORT) && defined(MAGICKCORE_HAVE_VSNPRINTF_L) { locale_t locale; @@ -443,7 +444,7 @@ MagickPrivate ssize_t FormatLocaleStringList(char *restrict string, #endif } #elif defined(MAGICKCORE_HAVE_VSNPRINTF) -#if defined(MAGICKCORE_HAVE_LOCALE_H) && defined(MAGICKCORE_HAVE_USELOCALE) +#if defined(MAGICKCORE_LOCALE_SUPPORT) && defined(MAGICKCORE_HAVE_USELOCALE) { locale_t locale, @@ -987,7 +988,7 @@ MagickExport double InterpretLocaleValue(const char *restrict string, value=(double) strtoul(string,&q,16); else { -#if defined(MAGICKCORE_HAVE_LOCALE_H) && defined(MAGICKCORE_HAVE_STRTOD_L) +#if defined(MAGICKCORE_LOCALE_SUPPORT) && defined(MAGICKCORE_HAVE_STRTOD_L) locale_t locale; @@ -1424,7 +1425,7 @@ MagickPrivate void LocaleComponentTerminus(void) LockSemaphoreInfo(locale_semaphore); if (locale_cache != (SplayTreeInfo *) NULL) locale_cache=DestroySplayTree(locale_cache); -#if defined(MAGICKCORE_HAVE_LOCALE_H) +#if defined(MAGICKCORE_LOCALE_SUPPORT) DestroyCLocale(); #endif UnlockSemaphoreInfo(locale_semaphore);