summaryrefslogtreecommitdiff
path: root/sv.c
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2000-08-28 18:57:52 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2000-08-28 18:57:52 +0000
commite5c81feb3d32a96869ed78abc5cecef7e294da38 (patch)
treeaf6fdcf1d9d868db2bdda099e6a51ceb3fccfdaf /sv.c
parentfa921dc629a49b7e24905db4197ca6edea472539 (diff)
downloadperl-e5c81feb3d32a96869ed78abc5cecef7e294da38.tar.gz
Fix for ID 20000828.001, long doubles were not formatted
correctly (showed up in $], which stopped installing perl). p4raw-id: //depot/perl@6863
Diffstat (limited to 'sv.c')
-rw-r--r--sv.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/sv.c b/sv.c
index f065084b5e..0501dcbbd6 100644
--- a/sv.c
+++ b/sv.c
@@ -6192,16 +6192,19 @@ Perl_sv_vcatpvfn(pTHX_ SV *sv, const char *pat, STRLEN patlen, va_list *args, SV
/* SIZE */
switch (*q) {
-#ifdef HAS_QUAD
+#if defined(HAS_QUAD) || (defined(HAS_LONG_DOUBLE) && defined(USE_LONG_DOUBLE))
case 'L': /* Ld */
+ /* FALL THROUGH */
+#endif
+#ifdef HAS_QUAD
case 'q': /* qd */
intsize = 'q';
q++;
break;
#endif
case 'l':
-#ifdef HAS_QUAD
- if (*(q + 1) == 'l') { /* lld */
+#if defined(HAS_QUAD) || (defined(HAS_LONG_DOUBLE) && defined(USE_LONG_DOUBLE))
+ if (*(q + 1) == 'l') { /* lld, llf */
intsize = 'q';
q += 2;
break;
@@ -6543,11 +6546,14 @@ Perl_sv_vcatpvfn(pTHX_ SV *sv, const char *pat, STRLEN patlen, va_list *args, SV
eptr = ebuf + sizeof ebuf;
*--eptr = '\0';
*--eptr = c;
-#ifdef USE_LONG_DOUBLE
+#if defined(USE_LONG_DOUBLE) && defined(PERL_PRIfldbl)
{
- static char const my_prifldbl[] = PERL_PRIfldbl;
- char const *p = my_prifldbl + sizeof my_prifldbl - 3;
- while (p >= my_prifldbl) { *--eptr = *p--; }
+ /* Copy the one or more characters in a long double
+ * format before the 'base' ([efgEFG]) character to
+ * the format string. */
+ static char const prifldbl[] = PERL_PRIfldbl;
+ char const *p = prifldbl + sizeof(prifldbl) - 3;
+ while (p >= prifldbl) { *--eptr = *p--; }
}
#endif
if (has_precis) {