]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Sun, 17 May 2015 12:49:39 +0000 (12:49 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Sun, 17 May 2015 12:49:39 +0000 (12:49 +0000)
MagickCore/locale.c

index d806f70945f0222fea3972e66d1a4c45e066d6dd..76fade0216dbad221602d0b7b059c43fe0e4a890 100644 (file)
@@ -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
 \f
@@ -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
 \f
 /*
   Forward declarations.
@@ -104,7 +105,7 @@ static MagickBooleanType
   LoadLocaleCache(SplayTreeInfo *,const char *,const char *,const char *,
     const size_t,ExceptionInfo *);
 \f
-#if defined(MAGICKCORE_HAVE_LOCALE_H)
+#if defined(MAGICKCORE_LOCALE_SUPPORT)
 /*
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %                                                                             %
@@ -234,7 +235,7 @@ static SplayTreeInfo *AcquireLocaleSplayTree(const char *filename,
   return(locale_cache);
 }
 \f
-#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);