diff options
author | Karl Williamson <khw@cpan.org> | 2019-04-17 22:22:48 -0600 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2019-04-19 10:26:59 -0600 |
commit | 9ec8aea5c056c7d3ffc270a57c9fb123a6416473 (patch) | |
tree | 83266c685998f971684e5ceaecb6d75ca5b30f06 /embed.h | |
parent | e8aa9efe194720b3919085f4299f812d661d5d53 (diff) | |
download | perl-9ec8aea5c056c7d3ffc270a57c9fb123a6416473.tar.gz |
Create Strtod()
This commit creates my_strod() and a synonym, Strtod(), to emulate
strtod() using the most precise function known to us that is available
on the platform. strtod() is not in K&R, but is in C90, so atof() may
be silently substituted instead on those few platforms without it.
This function also correctly handles locale issues, such as if the radix
character should be a dot or comma (or something else) depending on the
parent perl code is using locale or not, and which locale.
The symbol Perl_strtod continues to be defined on platforms which have
some version of strtod(), for backward compatibility, and can be called
as a function (or rather macro) but most applications should just use
Strtod() and not sweat the details.
This commit also fixes the problems with the prior commit:
commit 4ac6fab20b8950ee14756c6f2438809c572082cd
Author: Karl Williamson <khw@cpan.org>
Date: Mon Apr 15 11:10:31 2019 -0600
PATCH: [perl #133945] Perl_strtod failures
This commit wraps Perl_strtod() in macros that cause the proper
radix character to be used.
Diffstat (limited to 'embed.h')
-rw-r--r-- | embed.h | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -490,6 +490,7 @@ #define my_setenv(a,b) Perl_my_setenv(aTHX_ a,b) #define my_socketpair Perl_my_socketpair #define my_strftime(a,b,c,d,e,f,g,h,i,j) Perl_my_strftime(aTHX_ a,b,c,d,e,f,g,h,i,j) +#define my_strtod Perl_my_strtod #define newANONATTRSUB(a,b,c,d) Perl_newANONATTRSUB(aTHX_ a,b,c,d) #define newANONHASH(a) Perl_newANONHASH(aTHX_ a) #define newANONLIST(a) Perl_newANONLIST(aTHX_ a) |