@@ -215,9 +215,6 @@ static const char C_thousands_sep[] = "";
215
215
#if defined(HAS_NL_LANGINFO_L ) || defined(HAS_NL_LANGINFO )
216
216
# define HAS_SOME_LANGINFO
217
217
#endif
218
- #if defined(HAS_LOCALECONV ) || defined(HAS_LOCALECONV_L )
219
- # define HAS_SOME_LOCALECONV
220
- #endif
221
218
222
219
#define my_langinfo_c (item , category , locale , retbufp , retbuf_sizep , utf8ness ) \
223
220
my_langinfo_i(item, category##_INDEX_, locale, retbufp, \
@@ -1822,7 +1819,7 @@ S_setlocale_failure_panic_i(pTHX_
1822
1819
1823
1820
/* Any of these will allow us to find the RADIX */
1824
1821
# if defined(USE_LOCALE_NUMERIC ) && ( defined(HAS_SOME_LANGINFO ) \
1825
- || defined(HAS_SOME_LOCALECONV ) \
1822
+ || defined(HAS_LOCALECONV ) \
1826
1823
|| defined(HAS_SNPRINTF ))
1827
1824
# define CAN_CALCULATE_RADIX
1828
1825
# endif
@@ -3196,7 +3193,7 @@ HV *
3196
3193
Perl_localeconv (pTHX )
3197
3194
{
3198
3195
3199
- #if ! defined(HAS_SOME_LOCALECONV ) \
3196
+ #if ! defined(HAS_LOCALECONV ) \
3200
3197
|| (! defined(USE_LOCALE_MONETARY ) && ! defined(USE_LOCALE_NUMERIC ))
3201
3198
3202
3199
return newHV ();
@@ -3209,7 +3206,7 @@ Perl_localeconv(pTHX)
3209
3206
3210
3207
}
3211
3208
3212
- #if defined(HAS_SOME_LOCALECONV ) \
3209
+ #if defined(HAS_LOCALECONV ) \
3213
3210
&& (defined(USE_LOCALE_MONETARY ) || defined(USE_LOCALE_NUMERIC ))
3214
3211
3215
3212
HV *
@@ -3292,50 +3289,13 @@ S_my_localeconv(pTHX_ const int item)
3292
3289
PERL_ARGS_ASSERT_MY_LOCALECONV ;
3293
3290
/*--------------------------------------------------------------------------*/
3294
3291
/* Here, we are done with the common beginning of all the implementations of
3295
- * my_localeconv(). Below are the various terminations of the function (except
3292
+ * my_localeconv(). Below are the two terminations of the function (except
3296
3293
* the closing '}'. They are separated out because the preprocessor directives
3297
3294
* were making the simple logic hard to follow. Each implementation ends with
3298
3295
* the same few lines. khw decided to keep those separate because he thought
3299
3296
* it was clearer to the reader.
3300
- *
3301
- * The first distinct termination (of the above common code) are the
3302
- * implementations when we have locale_conv_l() and can use it. These are the
3303
- * simplest cases, without any locking needed. */
3304
- # if defined(USE_POSIX_2008_LOCALE ) && defined(HAS_LOCALECONV_L )
3305
-
3306
- /* And there are two sub-cases: First (by far the most common) is where we
3307
- * are compiled to pay attention to LC_NUMERIC */
3308
- # ifdef USE_LOCALE_NUMERIC
3309
-
3310
- const locale_t cur = use_curlocale_scratch ();
3311
- locale_t with_numeric = duplocale (cur );
3312
-
3313
- /* Just create a new locale object with what we've got, but using the
3314
- * underlying LC_NUMERIC locale */
3315
- with_numeric = newlocale (LC_NUMERIC_MASK , PL_numeric_name , with_numeric );
3316
-
3317
- retval = copy_localeconv (aTHX_ localeconv_l (with_numeric ),
3318
- item ,
3319
- numeric_locale_is_utf8 ,
3320
- monetary_locale_is_utf8 );
3321
- freelocale (with_numeric );
3322
-
3323
- return retval ;
3324
-
3325
- /*--------------------------------------------------------------------------*/
3326
- # else /* Below not paying attention to LC_NUMERIC */
3327
-
3328
- const locale_t cur = use_curlocale_scratch ();
3329
-
3330
- retval = copy_localeconv (aTHX_ localeconv_l (cur ),
3331
- item ,
3332
- numeric_locale_is_utf8 ,
3333
- monetary_locale_is_utf8 );
3334
- return retval ;
3335
-
3336
- # endif /* Above, using lconv_l(); below plain lconv() */
3337
- /*--------------------------------------------------------------------------*/
3338
- # elif ! defined(TS_W32_BROKEN_LOCALECONV ) /* Next is regular lconv() */
3297
+ *--------------------------------------------------------------------------*/
3298
+ # if ! defined(TS_W32_BROKEN_LOCALECONV ) /* Regular lconv() */
3339
3299
3340
3300
/* There are so many locks because localeconv() deals with two
3341
3301
* categories, and returns in a single global static buffer. Some
@@ -3845,7 +3805,7 @@ Perl_langinfo8(const nl_item item, utf8ness_t * utf8ness)
3845
3805
case CRNCYSTR :
3846
3806
3847
3807
#if defined(USE_LOCALE_MONETARY ) \
3848
- && (defined(HAS_SOME_LANGINFO ) || defined(HAS_SOME_LOCALECONV ))
3808
+ && (defined(HAS_SOME_LANGINFO ) || defined(HAS_LOCALECONV ))
3849
3809
3850
3810
cat_index = LC_MONETARY_INDEX_ ;
3851
3811
break ;
@@ -3866,7 +3826,7 @@ Perl_langinfo8(const nl_item item, utf8ness_t * utf8ness)
3866
3826
case THOUSEP :
3867
3827
3868
3828
#if defined(USE_LOCALE_NUMERIC ) \
3869
- && (defined(HAS_SOME_LANGINFO ) || defined(HAS_SOME_LOCALECONV ))
3829
+ && (defined(HAS_SOME_LANGINFO ) || defined(HAS_LOCALECONV ))
3870
3830
3871
3831
cat_index = LC_NUMERIC_INDEX_ ;
3872
3832
break ;
@@ -4116,7 +4076,7 @@ S_my_langinfo_i(pTHX_
4116
4076
case RADIXCHAR :
4117
4077
4118
4078
# if defined(HAS_SNPRINTF ) \
4119
- && (! defined(HAS_SOME_LOCALECONV ) || defined(TS_W32_BROKEN_LOCALECONV ))
4079
+ && (! defined(HAS_LOCALECONV ) || defined(TS_W32_BROKEN_LOCALECONV ))
4120
4080
4121
4081
{
4122
4082
/* snprintf() can be used to find the radix character by outputting
@@ -4180,8 +4140,8 @@ S_my_langinfo_i(pTHX_
4180
4140
Safefree (floatbuf );
4181
4141
}
4182
4142
4183
- # ifdef HAS_SOME_LOCALECONV /* snprintf() failed; drop down to use
4184
- localeconv() */
4143
+ # ifdef HAS_LOCALECONV /* snprintf() failed; drop down to use
4144
+ localeconv() */
4185
4145
4186
4146
/* FALLTHROUGH */
4187
4147
@@ -4192,7 +4152,7 @@ S_my_langinfo_i(pTHX_
4192
4152
4193
4153
# endif
4194
4154
# endif
4195
- # ifdef HAS_SOME_LOCALECONV
4155
+ # ifdef HAS_LOCALECONV
4196
4156
4197
4157
/* These items are available from localeconv(). (To avoid using
4198
4158
* TS_W32_BROKEN_LOCALECONV, one could use GetNumberFormat and
@@ -4436,7 +4396,7 @@ S_my_langinfo_i(pTHX_
4436
4396
utf8ness_t is_utf8 = UTF8NESS_UNKNOWN ;
4437
4397
const char * scratch_buf = NULL ;
4438
4398
4439
- # if defined(USE_LOCALE_MONETARY ) && defined(HAS_SOME_LOCALECONV )
4399
+ # if defined(USE_LOCALE_MONETARY ) && defined(HAS_LOCALECONV )
4440
4400
4441
4401
/* Can't use this method unless localeconv() is available, as that's
4442
4402
* the way we find out the currency symbol. */
0 commit comments