From: Gurusamy Sarathy Date: Tue, 6 Jul 1999 08:54:03 +0000 (+0000) Subject: bug in change#3602 (cpp conditionals not allowed inside macro args) X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=572bbb43c768e4239ddeb3245621277ab450fe70;p=p5sagit%2Fp5-mst-13.2.git bug in change#3602 (cpp conditionals not allowed inside macro args) p4raw-link: @3602 on //depot/perl: 6520202708b2a849ca8538ed88e0f75376c3b2d7 p4raw-id: //depot/perl@3605 --- diff --git a/sv.c b/sv.c index e44c533..a61d2ea 100644 --- a/sv.c +++ b/sv.c @@ -1217,14 +1217,13 @@ Perl_sv_2iv(pTHX_ register SV *sv) SvNVX(sv) = d; (void)SvNOK_on(sv); (void)SvIOK_on(sv); - DEBUG_c(PerlIO_printf(Perl_debug_log, #if defined(USE_LONG_DOUBLE) - "0x%lx 2nv(%Lg)\n", + DEBUG_c(PerlIO_printf(Perl_debug_log, "0x%lx 2nv(%Lg)\n", + (unsigned long)sv, SvNVX(sv))); #else - "0x%lx 2nv(%g)\n", + DEBUG_c(PerlIO_printf(Perl_debug_log, "0x%lx 2nv(%g)\n", + (unsigned long)sv, SvNVX(sv))); #endif - (unsigned long)sv, - SvNVX(sv))); if (SvNVX(sv) < (NV)IV_MAX + 0.5) SvIVX(sv) = I_V(SvNVX(sv)); else { @@ -1362,14 +1361,13 @@ Perl_sv_2uv(pTHX_ register SV *sv) SvNVX(sv) = d; (void)SvNOK_on(sv); (void)SvIOK_on(sv); - DEBUG_c(PerlIO_printf(Perl_debug_log, #if defined(USE_LONG_DOUBLE) - "0x%lx 2nv(%Lg)\n", + DEBUG_c(PerlIO_printf(Perl_debug_log, "0x%lx 2nv(%Lg)\n", + (unsigned long)sv, SvNVX(sv))); #else - "0x%lx 2nv(%g)\n", + DEBUG_c(PerlIO_printf(Perl_debug_log, "0x%lx 2nv(%g)\n", + (unsigned long)sv, SvNVX(sv))); #endif - (unsigned long)sv, - SvNVX(sv))); if (SvNVX(sv) < -0.5) { SvIVX(sv) = I_V(SvNVX(sv)); goto ret_zero; @@ -1490,17 +1488,21 @@ Perl_sv_2nv(pTHX_ register SV *sv) sv_upgrade(sv, SVt_PVNV); else sv_upgrade(sv, SVt_NV); +#if defined(USE_LONG_DOUBLE) DEBUG_c({ RESTORE_NUMERIC_STANDARD(); - PerlIO_printf(Perl_debug_log, -#if defined(USE_LONG_DOUBLE) - "0x%lx num(%Lg)\n", + PerlIO_printf(Perl_debug_log, "0x%lx num(%Lg)\n", + (unsigned long)sv, SvNVX(sv)); + RESTORE_NUMERIC_LOCAL(); + }); #else - "0x%lx num(%g)\n", -#endif - (unsigned long)sv,SvNVX(sv))); + DEBUG_c({ + RESTORE_NUMERIC_STANDARD(); + PerlIO_printf(Perl_debug_log, "0x%lx num(%g)\n", + (unsigned long)sv, SvNVX(sv)); RESTORE_NUMERIC_LOCAL(); }); +#endif } else if (SvTYPE(sv) < SVt_PVNV) sv_upgrade(sv, SVt_PVNV); @@ -1525,17 +1527,21 @@ Perl_sv_2nv(pTHX_ register SV *sv) return 0.0; } SvNOK_on(sv); +#if defined(USE_LONG_DOUBLE) DEBUG_c({ RESTORE_NUMERIC_STANDARD(); - PerlIO_printf(Perl_debug_log, -#if defined(USE_LONG_DOUBLE) - "0x%lx 2nv(%Lg)\n", + PerlIO_printf(Perl_debug_log, "0x%lx 2nv(%Lg)\n", + (unsigned long)sv, SvNVX(sv)); + RESTORE_NUMERIC_LOCAL(); + }); #else - "0x%lx 1nv(%g)\n", -#endif - (unsigned long)sv,SvNVX(sv))); + DEBUG_c({ + RESTORE_NUMERIC_STANDARD(); + PerlIO_printf(Perl_debug_log, "0x%lx 1nv(%g)\n", + (unsigned long)sv, SvNVX(sv)); RESTORE_NUMERIC_LOCAL(); }); +#endif return SvNVX(sv); }