/* getenv used for regular logical names */
# define getenv(v) my_getenv(v,TRUE)
#endif
-#if defined(getenv_len)
-#undef getenv_len
+#ifdef getenv_len
+# undef getenv_len
#endif
#define getenv_len(v,l) my_getenv_len(v,l,TRUE)
/* Our own contribution to PerlShr's global symbols . . . */
#define vmstrnenv Perl_vmstrnenv
#define my_trnlnm Perl_my_trnlnm
-#define my_getenv Perl_my_getenv
#define my_getenv_len Perl_my_getenv_len
#define prime_env_iter Perl_prime_env_iter
#define vmssetenv Perl_vmssetenv
+#if !defined(PERL_IMPLICIT_CONTEXT)
#define my_setenv Perl_my_setenv
+#define my_getenv Perl_my_getenv
+#else
+#define my_setenv(a,b) Perl_my_setenv(aTHX_ a,b)
+#define my_getenv(a,b) Perl_my_getenv(aTHX_ a,b)
+#endif
#define my_crypt Perl_my_crypt
#define my_waitpid Perl_my_waitpid
#define my_gconvert Perl_my_gconvert
*/
#define ALTERNATE_SHEBANG "$"
+/* Lower case entry points for these are missing in some earlier RTLs
+ * so we borrow the defines and declares from errno.h and upcase them.
+ */
+#if defined(VMS_WE_ARE_CASE_SENSITIVE) && (__DECC_VER < 50500000)
+# define errno (*CMA$TIS_ERRNO_GET_ADDR())
+# define vaxc$errno (*CMA$TIS_VMSERRNO_GET_ADDR())
+ int *CMA$TIS_ERRNO_GET_ADDR (void); /* UNIX style error code */
+ int *CMA$TIS_VMSERRNO_GET_ADDR (void); /* VMS error (errno == EVMSERR) */
+#endif
+
/* Macros to set errno using the VAX thread-safe calls, if present */
#if (defined(__DECC) || defined(__DECCXX)) && !defined(__ALPHA)
# define set_errno(v) (cma$tis_errno_set_value(v))
#define COMPLEX_STATUS 1 /* We track both "POSIX" and VMS values */
#define HINT_V_VMSISH 24
-#define HINT_M_VMSISH_STATUS 0x20000000 /* system, $? return VMS status */
-#define HINT_M_VMSISH_EXIT 0x40000000 /* exit(1) ==> SS$_NORMAL */
+#define HINT_M_VMSISH_HUSHED 0x20000000 /* stifle error msgs on exit */
+#define HINT_M_VMSISH_STATUS 0x40000000 /* system, $? return VMS status */
#define HINT_M_VMSISH_TIME 0x80000000 /* times are local, not UTC */
#define NATIVE_HINTS (PL_hints >> HINT_V_VMSISH) /* used in op.c */
#define TEST_VMSISH(h) (PL_curcop->op_private & ((h) >> HINT_V_VMSISH))
+#define VMSISH_HUSHED TEST_VMSISH(HINT_M_VMSISH_HUSHED)
#define VMSISH_STATUS TEST_VMSISH(HINT_M_VMSISH_STATUS)
-#define VMSISH_EXIT TEST_VMSISH(HINT_M_VMSISH_EXIT)
#define VMSISH_TIME TEST_VMSISH(HINT_M_VMSISH_TIME)
/* Flags for vmstrnenv() */
#define _ckvmssts(call) STMT_START { register unsigned long int __ckvms_sts; \
if (!((__ckvms_sts=(call))&1)) { \
set_errno(EVMSERR); set_vaxc_errno(__ckvms_sts); \
- croak("Fatal VMS error (status=%d) at %s, line %d", \
+ Perl_croak(aTHX_ "Fatal VMS error (status=%d) at %s, line %d", \
__ckvms_sts,__FILE__,__LINE__); } } STMT_END
/* Same thing, but don't call back to Perl's croak(); useful for errors
#define BIT_BUCKET "_NLA0:"
#define PERL_SYS_INIT(c,v) vms_image_init((c),(v)); MALLOC_INIT
-#define PERL_SYS_TERM() MALLOC_TERM
+#define PERL_SYS_TERM() OP_REFCNT_TERM; MALLOC_TERM
#define dXSUB_SYS
#define HAS_KILL
#define HAS_WAIT
+#define PERL_FS_VER_FMT "%d_%d_%d"
+/* Temporary; we need to add support for this to Configure.Com */
+#ifdef PERL_INC_VERSION_LIST
+# undef PERL_INC_VERSION_LIST
+#endif
+
/* VMS:
* This symbol, if defined, indicates that the program is running under
* VMS. It's a symbol automagically defined by all VMS C compilers I've seen.
/* USEMYBINMODE
* This symbol, if defined, indicates that the program should
- * use the routine my_binmode(FILE *fp, char iotype) to insure
+ * use the routine my_binmode(FILE *fp, char iotype, int mode) to insure
* that a file is in "binary" mode -- that is, that no translation
* of bytes occurs on read or write operations.
*/
};
typedef unsigned mydev_t;
typedef unsigned myino_t;
+
+/*
+ * DEC C previous to 6.0 corrupts the behavior of the /prefix
+ * qualifier with the extern prefix pragma. This provisional
+ * hack circumvents this prefix pragma problem in previous
+ * precompilers.
+ */
+#if defined(__VMS_VER) && __VMS_VER >= 70000000
+# if defined(VMS_WE_ARE_CASE_SENSITIVE) && (__DECC_VER < 60000000)
+# pragma __extern_prefix save
+# pragma __extern_prefix "" /* set to empty to prevent prefixing */
+# define geteuid decc$__unix_geteuid
+# define getuid decc$__unix_getuid
+# define stat(__p1,__p2) decc$__utc_stat(__p1,__p2)
+# define fstat(__p1,__p2) decc$__utc_fstat(__p1,__p2)
+# pragma __extern_prefix restore
+# endif
+#endif
+
#ifndef DONT_MASK_RTL_CALLS /* defined for vms.c so we can see RTL calls */
# ifdef stat
# undef stat
#define S_IDGRP (S_IWGRP | S_IXGRP)
#define S_IDOTH (S_IWOTH | S_IXOTH)
+
/* Prototypes for functions unique to vms.c. Don't include replacements
* for routines in the mainline source files excluded by #ifndef VMS;
* their prototypes are already in proto.h.
typedef char __VMS_PROTOTYPES__;
int vmstrnenv (const char *, char *, unsigned long int, struct dsc$descriptor_s **, unsigned long int);
int my_trnlnm (const char *, char *, unsigned long int);
-char * my_getenv (const char *, bool);
+#if !defined(PERL_IMPLICIT_CONTEXT)
+char * Perl_my_getenv (const char *, bool);
+#else
+char * Perl_my_getenv (pTHX_ const char *, bool);
+#endif
char * my_getenv_len (const char *, unsigned long *, bool);
int vmssetenv (char *, char *, struct dsc$descriptor_s **);
char * my_crypt (const char *, const char *);
int my_sigismember (sigset_t *, int);
int my_sigprocmask (int, sigset_t *, sigset_t *);
#endif
-I32 cando_by_name (I32, I32, char *);
+I32 cando_by_name (I32, Uid_t, char *);
int flex_fstat (int, Stat_t *);
int flex_stat (const char *, Stat_t *);
int trim_unixpath (char *, char*, int);
#undef HAS_NTOHL
#endif
-#define TMPPATH "sys$scratch:perl-eXXXXXX"
+/* The C RTL manual says to undef the macro for DEC C 5.2 and lower. */
+#if defined(fileno) && defined(__DECC_VER) && __DECC_VER < 50300000
+# undef fileno
+#endif
#endif /* __vmsish_h_included */