From: Jarkko Hietaniemi Date: Wed, 17 Oct 2001 16:42:49 +0000 (+0000) Subject: (retracted by #12485) X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=a385c4e7bdc7cbc9f50e4f013b7a373e7450e199;p=p5sagit%2Fp5-mst-13.2.git (retracted by #12485) Avoid dollar signs in identifiers (in non-VMS) to placate ultra picky ANSI compilers (such as DEC^WCPQ^WHP). p4raw-id: //depot/perl@12475 --- diff --git a/doio.c b/doio.c index ebcd071..0bfce2e 100644 --- a/doio.c +++ b/doio.c @@ -338,7 +338,7 @@ Perl_do_openn(pTHX_ GV *gv, register char *name, I32 len, int as_raw, } if (!thatio) { #ifdef EINVAL - SETERRNO(EINVAL,SS$_IVCHAN); + SETERRNO(EINVAL,VMS_SS_IVCHAN); #endif goto say_false; } @@ -898,7 +898,7 @@ Perl_do_close(pTHX_ GV *gv, bool not_implicit) gv = PL_argvgv; if (!gv || SvTYPE(gv) != SVt_PVGV) { if (not_implicit) - SETERRNO(EBADF,SS$_IVCHAN); + SETERRNO(EBADF,VMS_SS_IVCHAN); return FALSE; } io = GvIO(gv); @@ -906,7 +906,7 @@ Perl_do_close(pTHX_ GV *gv, bool not_implicit) if (not_implicit) { if (ckWARN(WARN_UNOPENED)) /* no check for closed here */ report_evil_fh(gv, io, PL_op->op_type); - SETERRNO(EBADF,SS$_IVCHAN); + SETERRNO(EBADF,VMS_SS_IVCHAN); } return FALSE; } @@ -950,7 +950,7 @@ Perl_io_close(pTHX_ IO *io, bool not_implicit) IoOFP(io) = IoIFP(io) = Nullfp; } else if (not_implicit) { - SETERRNO(EBADF,SS$_IVCHAN); + SETERRNO(EBADF,VMS_SS_IVCHAN); } return retval; @@ -1025,7 +1025,7 @@ Perl_do_tell(pTHX_ GV *gv) } if (ckWARN2(WARN_UNOPENED,WARN_CLOSED)) report_evil_fh(gv, io, PL_op->op_type); - SETERRNO(EBADF,RMS$_IFI); + SETERRNO(EBADF,VMS_RMS_IFI); return (Off_t)-1; } @@ -1044,7 +1044,7 @@ Perl_do_seek(pTHX_ GV *gv, Off_t pos, int whence) } if (ckWARN2(WARN_UNOPENED,WARN_CLOSED)) report_evil_fh(gv, io, PL_op->op_type); - SETERRNO(EBADF,RMS$_IFI); + SETERRNO(EBADF,VMS_RMS_IFI); return FALSE; } @@ -1058,7 +1058,7 @@ Perl_do_sysseek(pTHX_ GV *gv, Off_t pos, int whence) return PerlLIO_lseek(PerlIO_fileno(fp), pos, whence); if (ckWARN2(WARN_UNOPENED,WARN_CLOSED)) report_evil_fh(gv, io, PL_op->op_type); - SETERRNO(EBADF,RMS$_IFI); + SETERRNO(EBADF,VMS_RMS_IFI); return (Off_t)-1; } @@ -2034,7 +2034,7 @@ Perl_do_semop(pTHX_ SV **mark, SV **sp) opbuf = SvPV(opstr, opsize); if (opsize < 3 * SHORTSIZE || (opsize % (3 * SHORTSIZE))) { - SETERRNO(EINVAL,LIB$_INVARG); + SETERRNO(EINVAL,VMS_LIB_INVARG); return -1; } SETERRNO(0,0); diff --git a/mg.c b/mg.c index 4e186e0..7953d76 100644 --- a/mg.c +++ b/mg.c @@ -1965,7 +1965,10 @@ Perl_magic_set(pTHX_ SV *sv, MAGIC *mg) break; case '!': SETERRNO(SvIOK(sv) ? SvIVX(sv) : SvOK(sv) ? sv_2iv(sv) : 0, - (SvIV(sv) == EVMSERR) ? 4 : vaxc$errno); +#ifdef VMS + (SvIV(sv) == EVMSERR) ? 4 : vaxc$errno +#else + 0); break; case '<': PL_uid = SvIOK(sv) ? SvIVX(sv) : sv_2iv(sv); diff --git a/perl.c b/perl.c index bd68c41..4e62d06 100644 --- a/perl.c +++ b/perl.c @@ -1416,7 +1416,7 @@ print \" \\@INC:\\n @INC\\n\";"); /* now parse the script */ - SETERRNO(0,SS$_NORMAL); + SETERRNO(0,VMS_SS_NORMAL); PL_error_count = 0; #ifdef MACOS_TRADITIONAL if (gMacPerl_SyntaxError = (yyparse() || PL_error_count)) { diff --git a/perl.h b/perl.h index 5e2eede..ac7032f 100644 --- a/perl.h +++ b/perl.h @@ -3926,4 +3926,23 @@ extern void moncontrol(int); #include "wince.h" #endif +/* These definitions are sneaky. + * Their only purpose is to avoid warnings on strict ANSI (non-VMS) + * compilers which get huffy about dollars in identifiers, + * which is common practise in VMS. The definitions in the + * non-VMS branch are not used -- but their only point is to + * be something non-dollared. */ +#ifdef VMS +#define VMS_SS_NORMAL SS$_NORMAL +#define VMS_SS_IVCHAN SS$_IVCHAN +#define VMS_RMS_IFI RMS$_FAC +#define VMS_RMS_IFI RMS$_IFI +#else +#define VMS_LIB_INVARG EINVAL +#define VMS_SS_NORMAL 0 +#define VMS_SS_IVCHAN EBADF +#define VMS_RMS_FAC 0 +#define VMS_RMS_IFI EBADF +#endif + #endif /* Include guard */ diff --git a/perlio.c b/perlio.c index dd9f394..638a1be 100644 --- a/perlio.c +++ b/perlio.c @@ -981,7 +981,7 @@ PerlIO__close(PerlIO *f) if (f && *f) return (*PerlIOBase(f)->tab->Close) (f); else { - SETERRNO(EBADF, SS$_IVCHAN); + SETERRNO(EBADF, VMS_SS_IVCHAN); return -1; } } @@ -998,7 +998,7 @@ PerlIO_fdupopen(pTHX_ PerlIO *f, CLONE_PARAMS *param) return new; } else { - SETERRNO(EBADF, SS$_IVCHAN); + SETERRNO(EBADF, VMS_SS_IVCHAN); return NULL; } } @@ -1025,7 +1025,7 @@ PerlIO_fileno(PerlIO *f) if (f && *f) return (*PerlIOBase(f)->tab->Fileno) (f); else { - SETERRNO(EBADF, SS$_IVCHAN); + SETERRNO(EBADF, VMS_SS_IVCHAN); return -1; } } @@ -1241,7 +1241,7 @@ PerlIO_read(PerlIO *f, void *vbuf, Size_t count) if (f && *f) return (*PerlIOBase(f)->tab->Read) (f, vbuf, count); else { - SETERRNO(EBADF, SS$_IVCHAN); + SETERRNO(EBADF, VMS_SS_IVCHAN); return -1; } } @@ -1253,7 +1253,7 @@ PerlIO_unread(PerlIO *f, const void *vbuf, Size_t count) if (f && *f) return (*PerlIOBase(f)->tab->Unread) (f, vbuf, count); else { - SETERRNO(EBADF, SS$_IVCHAN); + SETERRNO(EBADF, VMS_SS_IVCHAN); return -1; } } @@ -1265,7 +1265,7 @@ PerlIO_write(PerlIO *f, const void *vbuf, Size_t count) if (f && *f) return (*PerlIOBase(f)->tab->Write) (f, vbuf, count); else { - SETERRNO(EBADF, SS$_IVCHAN); + SETERRNO(EBADF, VMS_SS_IVCHAN); return -1; } } @@ -1277,7 +1277,7 @@ PerlIO_seek(PerlIO *f, Off_t offset, int whence) if (f && *f) return (*PerlIOBase(f)->tab->Seek) (f, offset, whence); else { - SETERRNO(EBADF, SS$_IVCHAN); + SETERRNO(EBADF, VMS_SS_IVCHAN); return -1; } } @@ -1289,7 +1289,7 @@ PerlIO_tell(PerlIO *f) if (f && *f) return (*PerlIOBase(f)->tab->Tell) (f); else { - SETERRNO(EBADF, SS$_IVCHAN); + SETERRNO(EBADF, VMS_SS_IVCHAN); return -1; } } @@ -1306,13 +1306,13 @@ PerlIO_flush(PerlIO *f) } else { PerlIO_debug("Cannot flush f=%p :%s\n", f, tab->name); - SETERRNO(EBADF, SS$_IVCHAN); + SETERRNO(EBADF, VMS_SS_IVCHAN); return -1; } } else { PerlIO_debug("Cannot flush f=%p\n", f); - SETERRNO(EBADF, SS$_IVCHAN); + SETERRNO(EBADF, VMS_SS_IVCHAN); return -1; } } @@ -1365,7 +1365,7 @@ PerlIO_fill(PerlIO *f) if (f && *f) return (*PerlIOBase(f)->tab->Fill) (f); else { - SETERRNO(EBADF, SS$_IVCHAN); + SETERRNO(EBADF, VMS_SS_IVCHAN); return -1; } } @@ -1377,7 +1377,7 @@ PerlIO_isutf8(PerlIO *f) if (f && *f) return (PerlIOBase(f)->flags & PERLIO_F_UTF8) != 0; else { - SETERRNO(EBADF, SS$_IVCHAN); + SETERRNO(EBADF, VMS_SS_IVCHAN); return -1; } } @@ -1389,7 +1389,7 @@ PerlIO_eof(PerlIO *f) if (f && *f) return (*PerlIOBase(f)->tab->Eof) (f); else { - SETERRNO(EBADF, SS$_IVCHAN); + SETERRNO(EBADF, VMS_SS_IVCHAN); return -1; } } @@ -1401,7 +1401,7 @@ PerlIO_error(PerlIO *f) if (f && *f) return (*PerlIOBase(f)->tab->Error) (f); else { - SETERRNO(EBADF, SS$_IVCHAN); + SETERRNO(EBADF, VMS_SS_IVCHAN); return -1; } } @@ -1413,7 +1413,7 @@ PerlIO_clearerr(PerlIO *f) if (f && *f) (*PerlIOBase(f)->tab->Clearerr) (f); else - SETERRNO(EBADF, SS$_IVCHAN); + SETERRNO(EBADF, VMS_SS_IVCHAN); } #undef PerlIO_setlinebuf @@ -1423,7 +1423,7 @@ PerlIO_setlinebuf(PerlIO *f) if (f && *f) (*PerlIOBase(f)->tab->Setlinebuf) (f); else - SETERRNO(EBADF, SS$_IVCHAN); + SETERRNO(EBADF, VMS_SS_IVCHAN); } #undef PerlIO_has_base @@ -1709,7 +1709,7 @@ PerlIOBase_pushed(PerlIO *f, const char *mode, SV *arg) l->flags |= PERLIO_F_TRUNCATE | PERLIO_F_CANWRITE; break; default: - SETERRNO(EINVAL, LIB$_INVARG); + SETERRNO(EINVAL, VMS_LIB_INVARG); return -1; } while (*mode) { @@ -1724,7 +1724,7 @@ PerlIOBase_pushed(PerlIO *f, const char *mode, SV *arg) l->flags |= PERLIO_F_CRLF; break; default: - SETERRNO(EINVAL, LIB$_INVARG); + SETERRNO(EINVAL, VMS_LIB_INVARG); return -1; } } @@ -1918,7 +1918,7 @@ PerlIOUnix_oflags(const char *mode) */ oflags |= O_BINARY; if (*mode || oflags == -1) { - SETERRNO(EINVAL, LIB$_INVARG); + SETERRNO(EINVAL, VMS_LIB_INVARG); oflags = -1; } return oflags; @@ -3548,7 +3548,7 @@ PerlIOMmap_map(PerlIO *f) if (!page_size) { #if defined(HAS_SYSCONF) && (defined(_SC_PAGESIZE) || defined(_SC_PAGE_SIZE)) { - SETERRNO(0, SS$_NORMAL); + SETERRNO(0, VMS_SS_NORMAL); # ifdef _SC_PAGESIZE page_size = sysconf(_SC_PAGESIZE); # else @@ -4055,7 +4055,7 @@ PerlIO_setpos(PerlIO *f, SV *pos) if (f && len == sizeof(Off_t)) return PerlIO_seek(f, *posn, SEEK_SET); } - SETERRNO(EINVAL, SS$_IVCHAN); + SETERRNO(EINVAL, VMS_SS_IVCHAN); return -1; } #else @@ -4075,7 +4075,7 @@ PerlIO_setpos(PerlIO *f, SV *pos) #endif } } - SETERRNO(EINVAL, SS$_IVCHAN); + SETERRNO(EINVAL, VMS_SS_IVCHAN); return -1; } #endif diff --git a/pp_ctl.c b/pp_ctl.c index 09c1a19..804e84f 100644 --- a/pp_ctl.c +++ b/pp_ctl.c @@ -3322,7 +3322,7 @@ trylocal: { RETPUSHUNDEF; } else - SETERRNO(0, SS$_NORMAL); + SETERRNO(0, VMS_SS_NORMAL); /* Assume success here to prevent recursive requirement. */ len = strlen(name); diff --git a/pp_hot.c b/pp_hot.c index 8c04a70..a2c1654 100644 --- a/pp_hot.c +++ b/pp_hot.c @@ -590,7 +590,7 @@ PP(pp_print) goto had_magic; if (ckWARN2(WARN_UNOPENED,WARN_CLOSED)) report_evil_fh(gv, io, PL_op->op_type); - SETERRNO(EBADF,RMS$_IFI); + SETERRNO(EBADF,VMS_RMS_IFI); goto just_say_no; } else if (!(fp = IoOFP(io))) { @@ -600,7 +600,7 @@ PP(pp_print) else if (ckWARN2(WARN_UNOPENED,WARN_CLOSED)) report_evil_fh(gv, io, PL_op->op_type); } - SETERRNO(EBADF,IoIFP(io)?RMS$_FAC:RMS$_IFI); + SETERRNO(EBADF,IoIFP(io)?VMS_RMS_FAC:VMS_RMS_IFI); goto just_say_no; } else { diff --git a/pp_sys.c b/pp_sys.c index 0abf357..b241a0e 100644 --- a/pp_sys.c +++ b/pp_sys.c @@ -1422,7 +1422,7 @@ PP(pp_prtf) if (!(io = GvIO(gv))) { if (ckWARN2(WARN_UNOPENED,WARN_CLOSED)) report_evil_fh(gv, io, PL_op->op_type); - SETERRNO(EBADF,RMS$_IFI); + SETERRNO(EBADF,VMS_RMS_IFI); goto just_say_no; } else if (!(fp = IoOFP(io))) { @@ -1444,7 +1444,7 @@ PP(pp_prtf) else if (ckWARN(WARN_CLOSED)) report_evil_fh(gv, io, PL_op->op_type); } - SETERRNO(EBADF,IoIFP(io)?RMS$_FAC:RMS$_IFI); + SETERRNO(EBADF,IoIFP(io)?VMS_RMS_FAC:VMS_RMS_IFI); goto just_say_no; } else { @@ -2080,7 +2080,7 @@ PP(pp_truncate) if (result) RETPUSHYES; if (!errno) - SETERRNO(EBADF,RMS$_IFI); + SETERRNO(EBADF,VMS_RMS_IFI); RETPUSHUNDEF; } #else @@ -2107,7 +2107,7 @@ PP(pp_ioctl) if (!io || !argsv || !IoIFP(io)) { if (ckWARN2(WARN_UNOPENED,WARN_CLOSED)) report_evil_fh(gv, io, PL_op->op_type); - SETERRNO(EBADF,RMS$_IFI); /* well, sort of... */ + SETERRNO(EBADF,VMS_RMS_IFI); /* well, sort of... */ RETPUSHUNDEF; } @@ -2195,7 +2195,7 @@ PP(pp_flock) if (ckWARN2(WARN_UNOPENED,WARN_CLOSED)) report_evil_fh(gv, io, PL_op->op_type); value = 0; - SETERRNO(EBADF,RMS$_IFI); + SETERRNO(EBADF,VMS_RMS_IFI); } PUSHi(value); RETURN; @@ -2225,7 +2225,7 @@ PP(pp_socket) report_evil_fh(gv, io, PL_op->op_type); if (IoIFP(io)) do_close(gv, FALSE); - SETERRNO(EBADF,LIB$_INVARG); + SETERRNO(EBADF,VMS_LIB_INVARG); RETPUSHUNDEF; } @@ -2376,7 +2376,7 @@ PP(pp_bind) nuts: if (ckWARN(WARN_CLOSED)) report_evil_fh(gv, io, PL_op->op_type); - SETERRNO(EBADF,SS$_IVCHAN); + SETERRNO(EBADF,VMS_SS_IVCHAN); RETPUSHUNDEF; #else DIE(aTHX_ PL_no_sock_func, "bind"); @@ -2406,7 +2406,7 @@ PP(pp_connect) nuts: if (ckWARN(WARN_CLOSED)) report_evil_fh(gv, io, PL_op->op_type); - SETERRNO(EBADF,SS$_IVCHAN); + SETERRNO(EBADF,VMS_SS_IVCHAN); RETPUSHUNDEF; #else DIE(aTHX_ PL_no_sock_func, "connect"); @@ -2432,7 +2432,7 @@ PP(pp_listen) nuts: if (ckWARN(WARN_CLOSED)) report_evil_fh(gv, io, PL_op->op_type); - SETERRNO(EBADF,SS$_IVCHAN); + SETERRNO(EBADF,VMS_SS_IVCHAN); RETPUSHUNDEF; #else DIE(aTHX_ PL_no_sock_func, "listen"); @@ -2494,7 +2494,7 @@ PP(pp_accept) nuts: if (ckWARN(WARN_CLOSED)) report_evil_fh(ggv, ggv ? GvIO(ggv) : 0, PL_op->op_type); - SETERRNO(EBADF,SS$_IVCHAN); + SETERRNO(EBADF,VMS_SS_IVCHAN); badexit: RETPUSHUNDEF; @@ -2521,7 +2521,7 @@ PP(pp_shutdown) nuts: if (ckWARN(WARN_CLOSED)) report_evil_fh(gv, io, PL_op->op_type); - SETERRNO(EBADF,SS$_IVCHAN); + SETERRNO(EBADF,VMS_SS_IVCHAN); RETPUSHUNDEF; #else DIE(aTHX_ PL_no_sock_func, "shutdown"); @@ -2600,7 +2600,7 @@ PP(pp_ssockopt) nuts: if (ckWARN(WARN_CLOSED)) report_evil_fh(gv, io, optype); - SETERRNO(EBADF,SS$_IVCHAN); + SETERRNO(EBADF,VMS_SS_IVCHAN); nuts2: RETPUSHUNDEF; @@ -2673,7 +2673,7 @@ PP(pp_getpeername) nuts: if (ckWARN(WARN_CLOSED)) report_evil_fh(gv, io, optype); - SETERRNO(EBADF,SS$_IVCHAN); + SETERRNO(EBADF,VMS_SS_IVCHAN); nuts2: RETPUSHUNDEF; @@ -3276,7 +3276,7 @@ PP(pp_fttext) gv = cGVOP_gv; report_evil_fh(gv, GvIO(gv), PL_op->op_type); } - SETERRNO(EBADF,RMS$_IFI); + SETERRNO(EBADF,VMS_RMS_IFI); RETPUSHUNDEF; } } @@ -3882,7 +3882,7 @@ PP(pp_closedir) RETPUSHYES; nope: if (!errno) - SETERRNO(EBADF,RMS$_IFI); + SETERRNO(EBADF,VMS_RMS_IFI); RETPUSHUNDEF; #else DIE(aTHX_ PL_no_dir_func, "closedir"); diff --git a/toke.c b/toke.c index af117bc..ce049c9 100644 --- a/toke.c +++ b/toke.c @@ -1935,7 +1935,7 @@ S_incl_perldb(pTHX) if (pdb) return pdb; - SETERRNO(0,SS$_NORMAL); + SETERRNO(0,VMS_SS_NORMAL); return "BEGIN { require 'perl5db.pl' }"; } return "";