Download Reference Manual
The Developer's Library for D
About Wiki Forums Source Search Contact

Ticket #1071: tango.stat.v3.patch

File tango.stat.v3.patch, 5.1 kB (added by e-t172, 6 months ago)

Third try

  • tango/stdc/posix/config.d

    old new  
    2424  } 
    2525    const bool  __USE_FILE_OFFSET64 = __USE_LARGEFILE64; 
    2626    const bool  __REDIRECT          = false; 
     27 
     28    version( X86 ) 
     29    { 
     30        const uint __WORDSIZE = 32; 
     31    } 
     32 
     33    version( X86_64 ) 
     34    { 
     35        const uint __WORDSIZE = 64; 
     36    } 
    2737} 
  • tango/stdc/posix/sys/types.d

    old new  
    3636 
    3737version( linux ) 
    3838{ 
    39   static if( __USE_FILE_OFFSET64 ) 
    40   { 
     39    // From <bits/typesizes.h> 
     40 
    4141    alias long      blkcnt_t; 
    42     alias ulong     ino_t; 
    43     alias long      off_t; 
    44   } 
    45   else 
    46   { 
    47     alias c_long    blkcnt_t; 
    48     alias c_ulong   ino_t; 
    49     alias c_long    off_t; 
    50   } 
    51     alias c_long    blksize_t; 
     42    alias long      blkcnt64_t; 
     43    alias long      blksize_t; 
    5244    alias ulong     dev_t; 
    5345    alias uint      gid_t; 
     46    alias ulong     ino_t; 
     47    alias ulong     ino64_t; 
    5448    alias uint      mode_t; 
    55     alias uint      nlink_t; 
     49    alias c_ulong   nlink_t; 
     50    alias long      off_t; 
     51    alias long      off64_t; 
    5652    alias int       pid_t; 
    5753    //size_t (defined in tango.stdc.stddef) 
    58     alias int       ssize_t; 
     54    alias c_long    ssize_t; 
    5955    //time_t (defined in tango.stdc.time) 
    6056    alias uint      uid_t; 
    6157} 
     
    107103 
    108104version( linux ) 
    109105{ 
    110   static if( __USE_FILE_OFFSET64 ) 
    111   { 
    112     alias ulong     fsblkcnt_t; 
    113     alias ulong     fsfilcnt_t; 
    114   } 
    115   else 
    116   { 
    117     alias c_ulong   fsblkcnt_t; 
    118     alias c_ulong   fsfilcnt_t; 
    119   } 
     106    // From <bits/typesizes.h> 
     107 
    120108    // clock_t (defined in tango.stdc.time) 
     109    alias c_ulong   fsblkcnt_t; 
     110    alias ulong     fsblkcnt64_t; 
     111    alias ulong     fsfilcnt_t; 
     112    alias ulong     fsfilcnt64_t; 
    121113    alias uint      id_t; 
    122114    alias int       key_t; 
    123115    alias c_long    suseconds_t; 
  • tango/stdc/posix/sys/stat.d

    old new  
    7979        struct stat_t 
    8080        { 
    8181            dev_t       st_dev; 
     82          static if( __WORDSIZE == 64 ) 
     83          { 
     84            ino64_t     st_ino; 
     85            nlink_t     st_nlink; 
     86            mode_t      st_mode; 
     87          } 
     88          else 
     89          { 
    8290            uint        __pad1; 
    8391            ino_t       __st_ino; 
    8492            mode_t      st_mode; 
    8593            nlink_t     st_nlink; 
     94          } 
    8695            uid_t       st_uid; 
    8796            gid_t       st_gid; 
     97          static if( __WORDSIZE == 64 ) 
     98          { 
     99            int         pad0; 
    88100            dev_t       st_rdev; 
     101            off_t       st_size; 
     102          } 
     103          else 
     104          { 
     105            dev_t       st_rdev; 
    89106            uint        __pad2; 
    90107            off64_t     st_size; 
     108          } 
    91109            blksize_t   st_blksize; 
    92110            blkcnt64_t  st_blocks; 
    93111 
     
    109127            time_t      st_ctime; 
    110128            c_ulong     st_ctimensec; 
    111129          } 
     130          static if ( __WORDSIZE == 64 ) 
     131          { 
     132            long        __unused[3]; 
     133          } 
     134          else 
     135          { 
    112136            ino64_t     st_ino; 
     137          } 
    113138        } 
    114139    } 
    115140    else 
     
    117142        struct stat_t 
    118143        { 
    119144            dev_t       st_dev; 
     145          static if( __WORDSIZE == 32 ) 
     146          { 
    120147            ushort      __pad1; 
    121           static if( __USE_FILE_OFFSET64 ) 
     148          } 
     149          static if( __WORDSIZE != 64 && __USE_FILE_OFFSET64 ) 
    122150          { 
    123151            ino_t       __st_ino; 
    124152          } 
     
    126154          { 
    127155            ino_t       st_ino; 
    128156          } 
     157          static if( __WORDSIZE == 32 ) 
     158          { 
    129159            mode_t      st_mode; 
    130160            nlink_t     st_nlink; 
     161          } 
     162          else 
     163          { 
     164            nlink_t     st_nlink; 
     165            mode_t      st_mode; 
     166          } 
    131167            uid_t       st_uid; 
    132168            gid_t       st_gid; 
     169          static if( __WORDSIZE == 64 ) 
     170          { 
     171            int         pad0; 
     172          } 
    133173            dev_t       st_rdev; 
     174          static if( __WORDSIZE == 32 ) 
     175          { 
    134176            ushort      __pad2; 
     177          } 
    135178            off_t       st_size; 
    136179            blksize_t   st_blksize; 
     180          static if( __WORDSIZE != 64 && __USE_FILE_OFFSET64 ) 
     181          { 
     182            blkcnt64_t  st_blocks; 
     183          } 
     184          else 
     185          { 
    137186            blkcnt_t    st_blocks; 
     187          } 
    138188          static if( false /*__USE_MISC*/ ) // true if _BSD_SOURCE || _SVID_SOURCE 
    139189          { 
    140190            timespec    st_atim; 
     
    153203            time_t      st_ctime; 
    154204            c_ulong     st_ctimensec; 
    155205          } 
     206          static if( __WORDSIZE == 64 ) 
     207          { 
     208            long[3]     __unused; 
     209          } 
    156210          static if( __USE_FILE_OFFSET64 ) 
    157211          { 
    158             ino_t       st_ino; 
     212            ino64_t     st_ino; 
    159213          } 
    160214          else 
    161215          {