summaryrefslogtreecommitdiff
path: root/numeric.c
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2017-08-01 12:41:12 -0600
committerKarl Williamson <khw@cpan.org>2017-11-08 20:21:43 -0700
commit9eda1ea6670ffea7d0f59d985c0ad45d7b53cdb8 (patch)
treeee9dcd6b31064bcc11d903c3bd0ceb67bdd582f3 /numeric.c
parent1ae85f6c8d94d4c819717d5024cbdbe30cd7d8f1 (diff)
downloadperl-9eda1ea6670ffea7d0f59d985c0ad45d7b53cdb8.tar.gz
numeric.c: Refactor #if #else in Perl_my_aotf
This simplifies things, eliminating nested #if's
Diffstat (limited to 'numeric.c')
-rw-r--r--numeric.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/numeric.c b/numeric.c
index f9c6778469..7065486497 100644
--- a/numeric.c
+++ b/numeric.c
@@ -1212,11 +1212,18 @@ Perl_my_atof(pTHX_ const char* s)
/* 's' must be NUL terminated */
NV x = 0.0;
+
+ PERL_ARGS_ASSERT_MY_ATOF;
+
#ifdef USE_QUADMATH
+
Perl_my_atof2(aTHX_ s, &x);
- return x;
-#elif defined(USE_LOCALE_NUMERIC)
- PERL_ARGS_ASSERT_MY_ATOF;
+
+#elif ! defined(USE_LOCALE_NUMERIC)
+
+ Perl_atof2(s, x);
+
+#else
{
DECLARATION_FOR_LC_NUMERIC_MANIPULATION;
@@ -1247,9 +1254,9 @@ Perl_my_atof(pTHX_ const char* s)
Perl_atof2(s, x);
RESTORE_LC_NUMERIC();
}
-#else
- Perl_atof2(s, x);
+
#endif
+
return x;
}