s |I32 |amagic_ncmp |NN SV *const a|NN SV *const b
s |I32 |amagic_i_ncmp |NN SV *const a|NN SV *const b
s |I32 |amagic_cmp |NN SV *const str1|NN SV *const str2
+# ifdef USE_LOCALE_COLLATE
s |I32 |amagic_cmp_locale|NN SV *const str1|NN SV *const str2
+#endif
s |I32 |sortcv |NN SV *const a|NN SV *const b
s |I32 |sortcv_xsub |NN SV *const a|NN SV *const b
s |I32 |sortcv_stacked |NN SV *const a|NN SV *const b
# endif
# if defined(PERL_IN_PP_SORT_C)
#define amagic_cmp(a,b) S_amagic_cmp(aTHX_ a,b)
-#define amagic_cmp_locale(a,b) S_amagic_cmp_locale(aTHX_ a,b)
#define amagic_i_ncmp(a,b) S_amagic_i_ncmp(aTHX_ a,b)
#define amagic_ncmp(a,b) S_amagic_ncmp(aTHX_ a,b)
#define qsortsvu(a,b,c) S_qsortsvu(aTHX_ a,b,c)
#define sortcv_xsub(a,b) S_sortcv_xsub(aTHX_ a,b)
#define sv_i_ncmp(a,b) S_sv_i_ncmp(aTHX_ a,b)
#define sv_ncmp(a,b) S_sv_ncmp(aTHX_ a,b)
+# if defined(USE_LOCALE_COLLATE)
+#define amagic_cmp_locale(a,b) S_amagic_cmp_locale(aTHX_ a,b)
+# endif
# endif
# if defined(PERL_IN_PP_SYS_C)
#define doform(a,b,c) S_doform(aTHX_ a,b,c)
#define PERLDB_SAVESRC_NOSUBS (PL_perldb && (PL_perldb & PERLDBf_SAVESRC_NOSUBS))
#define PERLDB_SAVESRC_INVALID (PL_perldb && (PL_perldb & PERLDBf_SAVESRC_INVALID))
+#ifdef USE_LOCALE
/* These locale things are all subject to change */
/* Returns TRUE if the plain locale pragma without a parameter is in effect
*/
#define IN_LC_RUNTIME(category) (IN_LC_ALL_RUNTIME || (IN_LC_PARTIAL_RUNTIME && _is_in_locale_category(FALSE, (category))))
#define IN_LC(category) (IN_LC_COMPILETIME(category) || IN_LC_RUNTIME(category))
+#else /* No locale usage */
+# define IN_LOCALE_RUNTIME 0
+# define IN_SOME_LOCALE_FORM_RUNTIME 0
+# define IN_LOCALE_COMPILETIME 0
+# define IN_SOME_LOCALE_FORM_COMPILETIME 0
+# define IN_LOCALE 0
+# define IN_SOME_LOCALE_FORM 0
+# define IN_LC_ALL_COMPILETIME 0
+# define IN_LC_ALL_RUNTIME 0
+# define IN_LC_PARTIAL_COMPILETIME 0
+# define IN_LC_PARTIAL_RUNTIME 0
+# define IN_LC_COMPILETIME(category) 0
+# define IN_LC_RUNTIME(category) 0
+# define IN_LC(category) 0
+#endif
+
#ifdef USE_LOCALE_NUMERIC
/* These macros are for toggling between the underlying locale (LOCAL) and the
#define UNLOCK_NUMERIC_STANDARD()
#define Atof my_atof
-#define IN_LOCALE_RUNTIME 0
-#define IN_LOCALE_COMPILETIME 0
#endif /* !USE_LOCALE_NUMERIC */
/* Here, is ucfirst non-UTF-8, not in locale (unless that locale is
* UTF-8, which we treat as not in locale), and cased latin1 */
UV title_ord;
-
+#ifdef USE_LOCALE_CTYPE
do_uni_rules:
+#endif
title_ord = _to_upper_title_latin1(*s, tmpbuf, &tculen, 's');
if (tculen > 1) {
}
}
else {
+#ifdef USE_LOCALE_CTYPE
do_uni_rules:
+#endif
for (; s < send; d++, s++) {
*d = toUPPER_LATIN1_MOD(*s);
if (LIKELY(*d != LATIN_SMALL_LETTER_Y_WITH_DIAERESIS)) {
*d = toFOLD(*s);
}
else {
+#ifdef USE_LOCALE_CTYPE
do_uni_folding:
+#endif
/* For ASCII and the Latin-1 range, there's only two troublesome
* folds, \x{DF} (\N{LATIN SMALL LETTER SHARP S}), which under full
* casefolding becomes 'ss'; and \x{B5} (\N{MICRO SIGN}), which
return sv_cmp(str1, str2);
}
+#ifdef USE_LOCALE_COLLATE
+
static I32
S_amagic_cmp_locale(pTHX_ SV *const str1, SV *const str2)
{
return sv_cmp_locale(str1, str2);
}
+#endif
+
/*
* Local variables:
* c-indentation-style: bsd
#define PERL_ARGS_ASSERT_AMAGIC_CMP \
assert(str1); assert(str2)
-STATIC I32 S_amagic_cmp_locale(pTHX_ SV *const str1, SV *const str2)
- __attribute__nonnull__(pTHX_1)
- __attribute__nonnull__(pTHX_2);
-#define PERL_ARGS_ASSERT_AMAGIC_CMP_LOCALE \
- assert(str1); assert(str2)
-
STATIC I32 S_amagic_i_ncmp(pTHX_ SV *const a, SV *const b)
__attribute__nonnull__(pTHX_1)
__attribute__nonnull__(pTHX_2);
#define PERL_ARGS_ASSERT_SV_NCMP \
assert(a); assert(b)
+# if defined(USE_LOCALE_COLLATE)
+STATIC I32 S_amagic_cmp_locale(pTHX_ SV *const str1, SV *const str2)
+ __attribute__nonnull__(pTHX_1)
+ __attribute__nonnull__(pTHX_2);
+#define PERL_ARGS_ASSERT_AMAGIC_CMP_LOCALE \
+ assert(str1); assert(str2)
+
+# endif
#endif
#if defined(PERL_IN_PP_SYS_C)
STATIC OP* S_doform(pTHX_ CV *cv, GV *gv, OP *retop)