From: Jarkko Hietaniemi Date: Mon, 28 Aug 2000 18:57:52 +0000 (+0000) Subject: Fix for ID 20000828.001, long doubles were not formatted X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=e5c81feb3d32a96869ed78abc5cecef7e294da38;p=p5sagit%2Fp5-mst-13.2.git Fix for ID 20000828.001, long doubles were not formatted correctly (showed up in $], which stopped installing perl). p4raw-id: //depot/perl@6863 --- diff --git a/sv.c b/sv.c index f065084..0501dcb 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) {