summaryrefslogtreecommitdiff
path: root/embed.h
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2019-04-17 22:22:48 -0600
committerKarl Williamson <khw@cpan.org>2019-04-19 10:26:59 -0600
commit9ec8aea5c056c7d3ffc270a57c9fb123a6416473 (patch)
tree83266c685998f971684e5ceaecb6d75ca5b30f06 /embed.h
parente8aa9efe194720b3919085f4299f812d661d5d53 (diff)
downloadperl-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.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/embed.h b/embed.h
index 930a44ab1e..75c91f77f4 100644
--- a/embed.h
+++ b/embed.h
@@ -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)