diff options
author | Karl Williamson <khw@cpan.org> | 2014-01-04 18:53:17 +0100 |
---|---|---|
committer | Karl Williamson <public@khwilliamson.com> | 2014-01-04 13:33:06 -0700 |
commit | 90d6b40e1850c1b0849446bc02c3ffe9a376aaee (patch) | |
tree | 41fd55b417fd2dfd60715196a1dbf0e4f63f8f41 /vutil.c | |
parent | 371d5d44b054ca1540da57f7be95194f1d92f449 (diff) | |
download | perl-90d6b40e1850c1b0849446bc02c3ffe9a376aaee.tar.gz |
vutil.c: Use existing macros instead of reinventing them
If there had been documentation referring to these macros, I would have
known they existed instead of reinventing them (not as well as the
originals).
Diffstat (limited to 'vutil.c')
-rw-r--r-- | vutil.c | 15 |
1 files changed, 2 insertions, 13 deletions
@@ -564,13 +564,7 @@ Perl_upg_version(pTHX_ SV *ver, bool qv) char tbuf[64]; SV *sv = SvNVX(ver) > 10e50 ? newSV(64) : 0; char *buf; -#ifdef USE_LOCALE_NUMERIC - char *loc = NULL; - if (! PL_numeric_standard) { - loc = savepv(setlocale(LC_NUMERIC, NULL)); - setlocale(LC_NUMERIC, "C"); - } -#endif + STORE_NUMERIC_LOCAL_SET_STANDARD(); if (sv) { Perl_sv_catpvf(aTHX_ sv, "%.9"NVff, SvNVX(ver)); len = SvCUR(sv); @@ -580,12 +574,7 @@ Perl_upg_version(pTHX_ SV *ver, bool qv) len = my_snprintf(tbuf, sizeof(tbuf), "%.9"NVff, SvNVX(ver)); buf = tbuf; } -#ifdef USE_LOCALE_NUMERIC - if (loc) { - setlocale(LC_NUMERIC, loc); - Safefree(loc); - } -#endif + RESTORE_NUMERIC_LOCAL(); while (buf[len-1] == '0' && len > 0) len--; if ( buf[len-1] == '.' ) len--; /* eat the trailing decimal */ version = savepvn(buf, len); |