Use defines in code instead of the start of the file.

This commit is contained in:
Dirk Lemstra
2025-06-06 14:27:36 +02:00
parent b2894bb375
commit 681ba6777d
+11 -15
View File
@@ -71,21 +71,9 @@
#endif
#if defined(MAGICKCORE_WINDOWS_SUPPORT)
# if !defined(freelocale)
# define freelocale _free_locale
# endif
# if !defined(locale_t)
# define locale_t _locale_t
# endif
# if !defined(strtod_l)
# define strtod_l _strtod_l
# endif
# if !defined(vfprintf_l)
# define vfprintf_l _vfprintf_l
# endif
# if !defined(vsnprintf_l)
# define vsnprintf_l _vsnprintf_l
# endif
#endif
#define LocaleFilename "locale.xml"
@@ -273,7 +261,11 @@ static SplayTreeInfo *AcquireLocaleSplayTree(const char *filename,
static void DestroyCLocale(void)
{
if (c_locale != (locale_t) NULL)
#if defined(MAGICKCORE_WINDOWS_SUPPORT)
_free_locale(c_locale);
#else
freelocale(c_locale);
#endif
c_locale=(locale_t) NULL;
}
#endif
@@ -358,7 +350,7 @@ MagickPrivate ssize_t FormatLocaleFileList(FILE *file,
n=(ssize_t) vfprintf(file,format,operands);
else
#if defined(MAGICKCORE_WINDOWS_SUPPORT)
n=(ssize_t) vfprintf_l(file,format,locale,operands);
n=(ssize_t) _vfprintf_l(file,format,locale,operands);
#else
n=(ssize_t) vfprintf_l(file,locale,format,operands);
#endif
@@ -449,7 +441,7 @@ MagickPrivate ssize_t FormatLocaleStringList(char *magick_restrict string,
n=(ssize_t) vsnprintf(string,length,format,operands);
else
#if defined(MAGICKCORE_WINDOWS_SUPPORT)
n=(ssize_t) vsnprintf_l(string,length,format,locale,operands);
n=(ssize_t) _vsnprintf_s_l(string,length,length,format,locale,operands);
#else
n=(ssize_t) vsnprintf_l(string,length,locale,format,operands);
#endif
@@ -1011,7 +1003,11 @@ MagickExport double InterpretLocaleValue(const char *magick_restrict string,
if (locale == (locale_t) NULL)
value=strtod(string,&q);
else
value=strtod_l(string,&q,locale);
#if defined(MAGICKCORE_WINDOWS_SUPPORT)
value=_strtod_l(string,&q,locale);
#else
value=strtod_l(string,&q,locale);
#endif
#else
value=strtod(string,&q);
#endif