summaryrefslogtreecommitdiff
path: root/mg.c
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>1999-11-02 20:46:27 +0000
committerJarkko Hietaniemi <jhi@iki.fi>1999-11-02 20:46:27 +0000
commitcd39f2b66bd181466dfcec205891c8c477478488 (patch)
tree21f5dde2bc1335cd1745fe514b6df8f4c6bf1ffa /mg.c
parent3cf5c1959ebd22791f34a1706083a3ce9aa50a39 (diff)
downloadperl-cd39f2b66bd181466dfcec205891c8c477478488.tar.gz
Initial integration of the MacPerl changes form Matthias.
p4raw-id: //depot/cfgperl@4508
Diffstat (limited to 'mg.c')
-rw-r--r--mg.c27
1 files changed, 22 insertions, 5 deletions
diff --git a/mg.c b/mg.c
index eed84f8ed6..151b33637c 100644
--- a/mg.c
+++ b/mg.c
@@ -408,6 +408,14 @@ Perl_magic_get(pTHX_ SV *sv, MAGIC *mg)
sv_setiv(sv, (IV)(PL_debug & 32767));
break;
case '\005': /* ^E */
+#ifdef MACOS_TRADITIONAL
+ {
+ char msg[256];
+
+ sv_setnv(sv,(double)gLastMacOSErr);
+ sv_setpv(sv, gLastMacOSErr ? GetSysErrText(gLastMacOSErr, msg) : "");
+ }
+#else
#ifdef VMS
{
# include <descrip.h>
@@ -453,6 +461,7 @@ Perl_magic_get(pTHX_ SV *sv, MAGIC *mg)
#endif
#endif
#endif
+#endif
SvNOK_on(sv); /* what a wonderful hack! */
break;
case '\006': /* ^F */
@@ -674,8 +683,10 @@ Perl_magic_get(pTHX_ SV *sv, MAGIC *mg)
break;
case '*':
break;
+#ifndef MACOS_TRADITIONAL
case '0':
break;
+#endif
#ifdef USE_THREADS
case '@':
sv_setsv(sv, thr->errsv);
@@ -1568,15 +1579,19 @@ Perl_magic_set(pTHX_ SV *sv, MAGIC *mg)
DEBUG_x(dump_all());
break;
case '\005': /* ^E */
-#ifdef VMS
- set_vaxc_errno(SvIOK(sv) ? SvIVX(sv) : sv_2iv(sv));
+#ifdef MACOS_TRADITIONAL
+ gLastMacOSErr = SvIOK(sv) ? SvIVX(sv) : sv_2iv(sv);
#else
-# ifdef WIN32
- SetLastError( SvIV(sv) );
+# ifdef VMS
+ set_vaxc_errno(SvIOK(sv) ? SvIVX(sv) : sv_2iv(sv));
# else
-# ifndef OS2
+# ifdef WIN32
+ SetLastError( SvIV(sv) );
+# else
+# ifndef OS2
/* will anyone ever use this? */
SETERRNO(SvIOK(sv) ? SvIVX(sv) : sv_2iv(sv), 4);
+# endif
# endif
# endif
#endif
@@ -1871,6 +1886,7 @@ Perl_magic_set(pTHX_ SV *sv, MAGIC *mg)
case ':':
PL_chopset = SvPV_force(sv,len);
break;
+#ifndef MACOS_TRADITIONAL
case '0':
if (!PL_origalen) {
s = PL_origargv[0];
@@ -1928,6 +1944,7 @@ Perl_magic_set(pTHX_ SV *sv, MAGIC *mg)
PL_origargv[i] = Nullch;
}
break;
+#endif
#ifdef USE_THREADS
case '@':
sv_setsv(thr->errsv, sv);