This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Better selection of homegrown ino_t in vmsish.h.
authorCraig A. Berry <craigberry@mac.com>
Sat, 9 Dec 2017 14:54:39 +0000 (08:54 -0600)
committerCraig A. Berry <craigberry@mac.com>
Sat, 9 Dec 2017 15:25:38 +0000 (09:25 -0600)
We had been using a 64-bit definition of myino_t only when
_LARGEFILE is defined, but we actually get large file support via
either _LARGEFILE or _USE_STD_STAT because both give us 64-bit
off_t, so look at both definitions.

The size of off_t is not any great indicator for the size of
ino_t, but this preserves the intent of the existing code.

TODO: figure out when _USE_STD_STAT became available; it's
possible we no longer need this hackish layer on top of the
stat struct.

vms/vmsish.h

index 4181abd..8dca211 100644 (file)
@@ -585,7 +585,7 @@ struct passwd {
 #endif
 
 typedef unsigned mydev_t;
-#ifndef _LARGEFILE
+#if !defined(_USE_STD_STAT) && !defined(_LARGEFILE)
 typedef unsigned myino_t;
 #else
 typedef __ino64_t myino_t;
@@ -595,7 +595,7 @@ struct mystat
 {
     struct stat crtl_stat;
     myino_t st_ino;
-#ifndef _LARGEFILE
+#if !defined(_USE_STD_STAT) && !defined(_LARGEFILE)
     unsigned rvn; /* FID (num,seq,rvn) + pad */
 #endif
     mydev_t st_dev;
@@ -616,7 +616,7 @@ struct mystat
 #define st_fab_fsz crtl_stat.st_fab_fsz
 #define st_fab_mrs crtl_stat.st_fab_mrs
 
-#ifdef _USE_STD_STAT
+#if defined(_USE_STD_STAT) || defined(_LARGEFILE)
 #define VMS_INO_T_COMPARE(__a, __b) (__a != __b)
 #define VMS_INO_T_COPY(__a, __b) __a = __b
 #else