tbuffer_t no longer exists on VMS.
authorCraig A. Berry <craigberry@mac.com>
Sun, 2 Mar 2014 14:33:28 +0000 (08:33 -0600)
committerCraig A. Berry <craigberry@mac.com>
Sun, 2 Mar 2014 15:22:58 +0000 (09:22 -0600)
It was replaced by the standard tms struct in v7.0, released in
1995.  Explicit support for pre-7.0 was removed in 32995a382d65b
for Perl 5.16, but I missed the tbuffer_t bit, which tripped up
Nicholas in 25983af42cdcf2dc, because he asked for:

  struct tbuffer_t

which via macro expansion became:

  struct struct tms

which failed to compile.  So remove code that's unnecessarily
different on VMS, leaving only a tbuffer_t compatibility macro
with a more appropriate comment so it will hopefully be less
likely to get used in new code.

pp_sys.c
vms/vmsish.h

index f1eabba..01e397a 100644 (file)
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -4397,14 +4397,7 @@ PP(pp_tms)
 #ifdef HAS_TIMES
     dVAR;
     dSP;
-#ifdef VMS
-    /* time.h uses different name for struct tms, though the same data is
-       returned.
-     */
-    struct tbuffer_t timesbuf;
-#else
     struct tms timesbuf;
-#endif
 
     EXTEND(SP, 4);
     (void)PerlProc_times(&timesbuf);
index 946bb4e..8493150 100644 (file)
@@ -472,23 +472,12 @@ struct utimbuf {
 #define utime my_utime
 #endif
 
-/* This is what times() returns, but <times.h> calls it tbuffer_t on VMS
- * prior to v7.0.  We check the DECC manifest to see whether it's already
- * done this for us, relying on the fact that perl.h #includes <time.h>
- * before it #includes "vmsish.h".
+/* tbuffer_t was replaced with struct tms in v7.0.  We no longer support
+ * systems prior to v7.0, but there could be old XS code out there that
+ * references tbuffer_t, so provide a compatibility macro.
  */
 
-#ifndef __TMS
-  struct tms {
-    clock_t tms_utime;    /* user time */
-    clock_t tms_stime;    /* system time - always 0 on VMS */
-    clock_t tms_cutime;   /* user time, children */
-    clock_t tms_cstime;   /* system time, children - always 0 on VMS */
-  };
-#else
-   /* The new headers change the times() prototype to tms from tbuffer */
-#  define tbuffer_t struct tms
-#endif
+#define tbuffer_t struct tms
 
 /* Substitute our own routines for gmtime(), localtime(), and time(),
  * which allow us to implement the vmsish 'time' pragma, and work