From d55f5ceb934a4f8b8b725330943b02e28145b855 Mon Sep 17 00:00:00 2001 From: Cristy Date: Mon, 28 Jan 2019 20:29:58 -0500 Subject: [PATCH] tolower_l / toupper_l is conditionally compiled --- MagickCore/locale.c | 19 ++++++++++--------- MagickCore/nt-base.h | 3 +++ configure | 2 +- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/MagickCore/locale.c b/MagickCore/locale.c index 265e4c544..28207f67c 100644 --- a/MagickCore/locale.c +++ b/MagickCore/locale.c @@ -290,9 +290,6 @@ static void DestroyCLocale(void) #if defined(MAGICKCORE_HAVE_NEWLOCALE) if (c_locale != (locale_t) NULL) freelocale(c_locale); -#elif defined(MAGICKCORE_WINDOWS_SUPPORT) && !defined(__MINGW32__) - if (c_locale != (locale_t) NULL) - _free_locale(c_locale); #endif c_locale=(locale_t) NULL; } @@ -1526,9 +1523,11 @@ MagickExport void LocaleLower(char *string) */ MagickExport int LocaleLowercase(const int c) { - if (c_locale == (locale_t) NULL) - return(tolower(c)); - return(tolower_l(c,c_locale)); +#if defined(MAGICKCORE_LOCALE_SUPPORT) + if (c_locale != (locale_t) NULL) + return(tolower_l(c,c_locale)); +#endif + return(tolower(c)); } /* @@ -1662,9 +1661,11 @@ MagickExport void LocaleUpper(char *string) */ MagickExport int LocaleUppercase(const int c) { - if (c_locale == (locale_t) NULL) - return(toupper(c)); - return(toupper_l(c,c_locale)); +#if defined(MAGICKCORE_LOCALE_SUPPORT) + if (c_locale != (locale_t) NULL) + return(toupper_l(c,c_locale)); +#endif + return(toupper(c)); } /* diff --git a/MagickCore/nt-base.h b/MagickCore/nt-base.h index 917c0fe11..fc2314de0 100644 --- a/MagickCore/nt-base.h +++ b/MagickCore/nt-base.h @@ -105,6 +105,9 @@ extern "C" { #if !defined(fileno) # define fileno _fileno #endif +#if !defined(freelocale) +# define freelocale _free_locale +#endif #if !defined(fseek) && !defined(__MINGW32__) #if defined(MAGICKCORE_WINDOWS_SUPPORT) && !defined(Windows95) && \ !(defined(_MSC_VER) && (_MSC_VER < 1400)) && \ diff --git a/configure b/configure index 0ca04d0a4..4b60327b7 100755 --- a/configure +++ b/configure @@ -4570,7 +4570,7 @@ MAGICK_PATCHLEVEL_VERSION=26 MAGICK_VERSION=7.0.8-26 -MAGICK_GIT_REVISION=15280:6e7c9e78a:20190128 +MAGICK_GIT_REVISION=15281:2f8969644:20190128 # Substitute library versioning -- 2.40.0