summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGisle Aas <gisle@activestate.com>2006-01-27 08:54:04 +0000
committerGisle Aas <gisle@activestate.com>2006-01-27 08:54:04 +0000
commit4b645107ff280e9efe46ab2fc89b620041a5b949 (patch)
treecd9142183e88c018f8365451377dcc3e08566798
parenteae92ea03dd0fc112e5aeae640f2e5f76eddcd7e (diff)
downloadperl-4b645107ff280e9efe46ab2fc89b620041a5b949.tar.gz
Simplify nested '#ifdef' by replacing it with '#elif defined()'
p4raw-id: //depot/perl@26954
-rw-r--r--mg.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/mg.c b/mg.c
index 8efed16f29..c2775760d5 100644
--- a/mg.c
+++ b/mg.c
@@ -680,15 +680,14 @@ Perl_magic_get(pTHX_ SV *sv, MAGIC *mg)
break;
case '\005': /* ^E */
if (nextchar == '\0') {
-#ifdef MACOS_TRADITIONAL
+#if defined(MACOS_TRADITIONAL)
{
char msg[256];
sv_setnv(sv,(double)gMacPerl_OSErr);
sv_setpv(sv, gMacPerl_OSErr ? GetSysErrText(gMacPerl_OSErr, msg) : "");
}
-#else
-#ifdef VMS
+#elif defined(VMS)
{
# include <descrip.h>
# include <starlet.h>
@@ -700,8 +699,7 @@ Perl_magic_get(pTHX_ SV *sv, MAGIC *mg)
else
sv_setpvn(sv,"",0);
}
-#else
-#ifdef OS2
+#elif defined(OS2)
if (!(_emx_env & 0x200)) { /* Under DOS */
sv_setnv(sv, (NV)errno);
sv_setpv(sv, errno ? Strerror(errno) : "");
@@ -714,8 +712,7 @@ Perl_magic_get(pTHX_ SV *sv, MAGIC *mg)
sv_setnv(sv, (NV)Perl_rc);
sv_setpv(sv, os2error(Perl_rc));
}
-#else
-#ifdef WIN32
+#elif defined(WIN32)
{
DWORD dwErr = GetLastError();
sv_setnv(sv, (NV)dwErr);
@@ -734,9 +731,6 @@ Perl_magic_get(pTHX_ SV *sv, MAGIC *mg)
errno = saveerrno;
}
#endif
-#endif
-#endif
-#endif
SvRTRIM(sv);
SvNOK_on(sv); /* what a wonderful hack! */
}