summaryrefslogtreecommitdiff
path: root/sv.c
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>1999-07-06 08:54:03 +0000
committerGurusamy Sarathy <gsar@cpan.org>1999-07-06 08:54:03 +0000
commit55f3590d981d472e2ca2027c95f8873bb0485b24 (patch)
treef6dfbcc27f3aafedc8536c55aa214d497cb0d3ba /sv.c
parent34b06dacb7d08d251fd34e73fbb3227302c523eb (diff)
downloadperl-55f3590d981d472e2ca2027c95f8873bb0485b24.tar.gz
bug in change#3602 (cpp conditionals not allowed inside macro args)
p4raw-link: @3602 on //depot/perl: 6520202708b2a849ca8538ed88e0f75376c3b2d7 p4raw-id: //depot/perl@3605
Diffstat (limited to 'sv.c')
-rw-r--r--sv.c50
1 files changed, 28 insertions, 22 deletions
diff --git a/sv.c b/sv.c
index e44c533bf3..a61d2eaa4c 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);
}