On Tue, 3 Apr 2001, Craig A. Berry wrote:

> Hmm.  It's in starlet.h on later systems, but it's not clear to me if
> the issue is OVMS pre-7.0, oldish C compiler, or VAX compiler and/or
> C RTL distribution.  Has anyone else run into this?  Since
> sys$setddir is #define'd in the same place that it's prototyped, we
> could test for it and prototype it in vmsish.h if it's missing.
> Here's what's in starlet.h:

Thanks.  The following liberal patch will allow the build of
[.vms.ext.stdio]stdio.xs without complaint on my particular
arch/os/compiler version combination:

--- perl-5.6.1/vms/ext/Stdio/Stdio.xs.orig      Tue Apr  3 18:36:38 2001
+++ perl-5.6.1/vms/ext/Stdio/Stdio.xs   Tue Apr  3 18:42:47 2001
@@ -13,6 +13,15 @@
 #include <iodef.h>
 #include <rms.h>
 #include <starlet.h>
+/* we need to add a prototype for older compilers such as
+   DEC C V5.3-006 on OpenVMS VAX V6.2 */
+#ifndef sys$setddir
+#define  sys$setddir  SYS$SETDDIR
+int sys$setddir(
+         void *newdiraddr,
+         unsigned short int *lengthaddr,
+         void *curdiraddr);
+#endif
 
 static bool
 constant(name, pval)
End of Possible patch.

Unfortunately that could run into re-prototyping errors on any
arch/os/compiler combination where sys$setddir is not defined but is
prototyped.  The following conservative patch ought to work as intended on
my compiler/os/arch combo, but I note that I have only tested the liberal
patch as being OK (somewhere between these extremes likely lies the ideal
patch?).  [note to pumpking: the build test and install is ok with neither
of these applied]:

--- perl-5.6.1/vms/ext/Stdio/Stdio.xs.orig      Tue Apr  3 18:36:38 2001
+++ perl-5.6.1/vms/ext/Stdio/Stdio.xs   Tue Apr  3 18:49:20 2001
@@ -13,6 +13,23 @@
 #include <iodef.h>
 #include <rms.h>
 #include <starlet.h>
+#if defined(__VMS_VER)
+#  if defined(__VAX)
+#    if defined(__DECC_VER)
+#      if __DECC_VER == 50390006 && __VMS_VER == 60200022
+/* we need to add a prototype for older compilers such as
+   DEC C V5.3-006 on OpenVMS VAX V6.2 */
+#        ifndef sys$setddir
+#define  sys$setddir  SYS$SETDDIR
+int sys$setddir(
+         void *newdiraddr,
+         unsigned short int *lengthaddr,
+         void *curdiraddr);
+#        endif
+#      endif  /* DECC_VER 50390006 && VMS_VER 60200022 */
+#    endif  /* __DECC_VER */
+#  endif  /* __VAX */
+#endif  /* __VMS_VER */
 
 static bool
 constant(name, pval)
End of possible conservative patch.

Peter Prymmer



Reply via email to