summaryrefslogtreecommitdiff
path: root/locale.c
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2022-09-04 18:52:23 -0600
committerKarl Williamson <khw@cpan.org>2022-09-10 09:27:17 -0600
commit057f0a44eea6a371212bff64f2688e675bf4fa60 (patch)
tree968d8ca858599032fc8d66fa7ce79103dffb9b83 /locale.c
parent988faa118b300f3ea030afabdbdbe464d204ddb1 (diff)
downloadperl-057f0a44eea6a371212bff64f2688e675bf4fa60.tar.gz
locale.c: Silence compiler warning when no LC_CTYPE
On Configurations without LC_CTYPE, various unused warnings were being generated.
Diffstat (limited to 'locale.c')
-rw-r--r--locale.c24
1 files changed, 11 insertions, 13 deletions
diff --git a/locale.c b/locale.c
index ada1476c35..4bdbff7f6c 100644
--- a/locale.c
+++ b/locale.c
@@ -1814,20 +1814,12 @@ Perl_set_numeric_underlying(pTHX)
}
-/*
- * Set up for a new ctype locale.
- */
+# ifdef USE_LOCALE_CTYPE
+
STATIC void
S_new_ctype(pTHX_ const char *newctype)
{
-# ifndef USE_LOCALE_CTYPE
-
- PERL_UNUSED_ARG(newctype);
- PERL_UNUSED_CONTEXT;
-
-# else
-
/* Called after each libc setlocale() call affecting LC_CTYPE, to tell
* core Perl this and that 'newctype' is the name of the new locale.
*
@@ -2222,11 +2214,10 @@ S_new_ctype(pTHX_ const char *newctype)
}
}
}
+}
# endif /* USE_LOCALE_CTYPE */
-}
-
void
Perl__warn_problematic_locale()
{
@@ -5251,7 +5242,10 @@ Perl_mem_collxfrm_(pTHX_ const char *input_string,
STRLEN xAlloc; /* xalloc is a reserved word in VC */
STRLEN length_in_chars;
bool first_time = TRUE; /* Cleared after first loop iteration */
- const char * orig_CTYPE_locale = NULL;
+
+# ifdef USE_LOCALE_CTYPE
+ const char * orig_CTYPE_locale = NULL;
+# endif
# if defined(USE_POSIX_2008_LOCALE) && defined HAS_STRXFRM_L
locale_t constructed_locale = (locale_t) 0;
@@ -5947,6 +5941,8 @@ S_restore_toggled_locale_i(pTHX_ const unsigned int cat_index,
}
+#ifdef USE_LOCALE_CTYPE
+
STATIC bool
S_is_codeset_name_UTF8(const char * name)
{
@@ -5972,6 +5968,8 @@ S_is_codeset_name_UTF8(const char * name)
&& (len == 4 || name[3] == '-'));
}
+#endif
+
STATIC bool
S_is_locale_utf8(pTHX_ const char * locale)
{