@@ -400,8 +400,9 @@ struct __num_get : protected __num_get_base {
400
400
unsigned *& __g_end,
401
401
unsigned & __dc,
402
402
_CharT* __atoms);
403
- # ifndef _LIBCPP_ABI_OPTIMIZED_LOCALE_NUM_GET
404
- static string __stage2_int_prep (ios_base& __iob, _CharT* __atoms, _CharT& __thousands_sep);
403
+
404
+ [[__deprecated__(" This exists only for ABI compatibility" )]] static string
405
+ __stage2_int_prep (ios_base& __iob, _CharT* __atoms, _CharT& __thousands_sep);
405
406
static int __stage2_int_loop (
406
407
_CharT __ct,
407
408
int __base,
@@ -414,55 +415,32 @@ struct __num_get : protected __num_get_base {
414
415
unsigned *& __g_end,
415
416
_CharT* __atoms);
416
417
417
- # else
418
- static string __stage2_int_prep (ios_base& __iob, _CharT& __thousands_sep) {
418
+ _LIBCPP_HIDE_FROM_ABI static string __stage2_int_prep (ios_base& __iob, _CharT& __thousands_sep) {
419
419
locale __loc = __iob.getloc ();
420
420
const numpunct<_CharT>& __np = use_facet<numpunct<_CharT> >(__loc);
421
421
__thousands_sep = __np.thousands_sep ();
422
422
return __np.grouping ();
423
423
}
424
424
425
- const _CharT* __do_widen (ios_base& __iob, _CharT* __atoms) const { return __do_widen_p (__iob, __atoms); }
426
-
427
- static int __stage2_int_loop (
428
- _CharT __ct,
429
- int __base,
430
- char * __a,
431
- char *& __a_end,
432
- unsigned & __dc,
433
- _CharT __thousands_sep,
434
- const string& __grouping,
435
- unsigned * __g,
436
- unsigned *& __g_end,
437
- const _CharT* __atoms);
425
+ _LIBCPP_HIDE_FROM_ABI const _CharT* __do_widen (ios_base& __iob, _CharT* __atoms) const {
426
+ return __do_widen_p (__iob, __atoms);
427
+ }
438
428
439
429
private:
440
430
template <typename _Tp>
441
- const _Tp* __do_widen_p (ios_base& __iob, _Tp* __atoms) const {
431
+ _LIBCPP_HIDE_FROM_ABI const _Tp* __do_widen_p (ios_base& __iob, _Tp* __atoms) const {
442
432
locale __loc = __iob.getloc ();
443
433
use_facet<ctype<_Tp> >(__loc).widen (__src, __src + __int_chr_cnt, __atoms);
444
434
return __atoms;
445
435
}
446
436
447
- const char * __do_widen_p (ios_base& __iob, char * __atoms) const {
437
+ _LIBCPP_HIDE_FROM_ABI const char * __do_widen_p (ios_base& __iob, char * __atoms) const {
448
438
(void )__iob;
449
439
(void )__atoms;
450
440
return __src;
451
441
}
452
- # endif
453
442
};
454
443
455
- # ifndef _LIBCPP_ABI_OPTIMIZED_LOCALE_NUM_GET
456
- template <class _CharT >
457
- string __num_get<_CharT>::__stage2_int_prep(ios_base& __iob, _CharT* __atoms, _CharT& __thousands_sep) {
458
- locale __loc = __iob.getloc ();
459
- std::use_facet<ctype<_CharT> >(__loc).widen (__src, __src + __int_chr_cnt, __atoms);
460
- const numpunct<_CharT>& __np = std::use_facet<numpunct<_CharT> >(__loc);
461
- __thousands_sep = __np.thousands_sep ();
462
- return __np.grouping ();
463
- }
464
- # endif
465
-
466
444
template <class _CharT >
467
445
string __num_get<_CharT>::__stage2_float_prep(
468
446
ios_base& __iob, _CharT* __atoms, _CharT& __decimal_point, _CharT& __thousands_sep) {
@@ -475,18 +453,17 @@ string __num_get<_CharT>::__stage2_float_prep(
475
453
}
476
454
477
455
template <class _CharT >
478
- int
479
- # ifndef _LIBCPP_ABI_OPTIMIZED_LOCALE_NUM_GET
480
- __num_get<_CharT>::__stage2_int_loop(_CharT __ct, int __base, char * __a, char *& __a_end,
481
- unsigned & __dc, _CharT __thousands_sep, const string& __grouping,
482
- unsigned * __g, unsigned *& __g_end, _CharT* __atoms)
483
- # else
484
- __num_get<_CharT>::__stage2_int_loop(_CharT __ct, int __base, char * __a, char *& __a_end,
485
- unsigned & __dc, _CharT __thousands_sep, const string& __grouping,
486
- unsigned * __g, unsigned *& __g_end, const _CharT* __atoms)
487
-
488
- # endif
489
- {
456
+ int __num_get<_CharT>::__stage2_int_loop(
457
+ _CharT __ct,
458
+ int __base,
459
+ char * __a,
460
+ char *& __a_end,
461
+ unsigned & __dc,
462
+ _CharT __thousands_sep,
463
+ const string& __grouping,
464
+ unsigned * __g,
465
+ unsigned *& __g_end,
466
+ _CharT* __atoms) {
490
467
if (__a_end == __a && (__ct == __atoms[24 ] || __ct == __atoms[25 ])) {
491
468
*__a_end++ = __ct == __atoms[24 ] ? ' +' : ' -' ;
492
469
__dc = 0 ;
@@ -856,14 +833,9 @@ _InputIterator num_get<_CharT, _InputIterator>::__do_get_signed(
856
833
// Stage 2
857
834
char_type __thousands_sep;
858
835
const int __atoms_size = __num_get_base::__int_chr_cnt;
859
- # ifdef _LIBCPP_ABI_OPTIMIZED_LOCALE_NUM_GET
860
836
char_type __atoms1[__atoms_size];
861
837
const char_type* __atoms = this ->__do_widen (__iob, __atoms1);
862
838
string __grouping = this ->__stage2_int_prep (__iob, __thousands_sep);
863
- # else
864
- char_type __atoms[__atoms_size];
865
- string __grouping = this ->__stage2_int_prep (__iob, __atoms, __thousands_sep);
866
- # endif
867
839
string __buf;
868
840
__buf.resize (__buf.capacity ());
869
841
char * __a = &__buf[0 ];
@@ -879,7 +851,17 @@ _InputIterator num_get<_CharT, _InputIterator>::__do_get_signed(
879
851
__a = &__buf[0 ];
880
852
__a_end = __a + __tmp;
881
853
}
882
- if (this ->__stage2_int_loop (*__b, __base, __a, __a_end, __dc, __thousands_sep, __grouping, __g, __g_end, __atoms))
854
+ if (this ->__stage2_int_loop (
855
+ *__b,
856
+ __base,
857
+ __a,
858
+ __a_end,
859
+ __dc,
860
+ __thousands_sep,
861
+ __grouping,
862
+ __g,
863
+ __g_end,
864
+ const_cast <char_type*>(__atoms)))
883
865
break ;
884
866
}
885
867
if (__grouping.size () != 0 && __g_end - __g < __num_get_base::__num_get_buf_sz)
@@ -905,14 +887,9 @@ _InputIterator num_get<_CharT, _InputIterator>::__do_get_unsigned(
905
887
// Stage 2
906
888
char_type __thousands_sep;
907
889
const int __atoms_size = __num_get_base::__int_chr_cnt;
908
- # ifdef _LIBCPP_ABI_OPTIMIZED_LOCALE_NUM_GET
909
890
char_type __atoms1[__atoms_size];
910
891
const char_type* __atoms = this ->__do_widen (__iob, __atoms1);
911
892
string __grouping = this ->__stage2_int_prep (__iob, __thousands_sep);
912
- # else
913
- char_type __atoms[__atoms_size];
914
- string __grouping = this ->__stage2_int_prep (__iob, __atoms, __thousands_sep);
915
- # endif
916
893
string __buf;
917
894
__buf.resize (__buf.capacity ());
918
895
char * __a = &__buf[0 ];
@@ -928,7 +905,17 @@ _InputIterator num_get<_CharT, _InputIterator>::__do_get_unsigned(
928
905
__a = &__buf[0 ];
929
906
__a_end = __a + __tmp;
930
907
}
931
- if (this ->__stage2_int_loop (*__b, __base, __a, __a_end, __dc, __thousands_sep, __grouping, __g, __g_end, __atoms))
908
+ if (this ->__stage2_int_loop (
909
+ *__b,
910
+ __base,
911
+ __a,
912
+ __a_end,
913
+ __dc,
914
+ __thousands_sep,
915
+ __grouping,
916
+ __g,
917
+ __g_end,
918
+ const_cast <char_type*>(__atoms)))
932
919
break ;
933
920
}
934
921
if (__grouping.size () != 0 && __g_end - __g < __num_get_base::__num_get_buf_sz)
0 commit comments