ソースを参照

* fixed dirent handling for DragonFly BSD (patch by John Marino,
mantis #29228)

git-svn-id: trunk@32706 -

Jonas Maebe 9 年 前
コミット
f8f03ac4ad
2 ファイル変更15 行追加0 行削除
  1. 4 0
      rtl/bsd/ossysc.inc
  2. 11 0
      rtl/bsd/ostypes.inc

+ 4 - 0
rtl/bsd/ossysc.inc

@@ -282,7 +282,11 @@ begin
  repeat
   novalid:=false;
   CurEntry:=pdirent(dirp^.dd_rewind);
+{$ifdef dragonfly}
+  RecLen:=(CurEntry^.d_namlen + 24) and $FFFFFFF8;
+{$else}
   RecLen:=CurEntry^.d_reclen;
+{$endif}
   if RecLen<>0 Then
    begin {valid direntry?}
     if CurEntry^.d_fileno<>0 then

+ 11 - 0
rtl/bsd/ostypes.inc

@@ -145,6 +145,16 @@ TYPE
 
   { directory services }
 {$ifndef darwin_new_iostructs}
+{$ifdef dragonfly}
+   dirent  = record
+        d_fileno      : ino_t;                          // file number of entry
+        d_namlen      : cuint16;                        // strlen (d_name)
+        d_type        : cuint8;                         // file type, see below
+        d_unused1     : cuint8;                         // padding, reserved
+        d_unused2     : cuint32;                        // reserved
+        d_name        : array[0..255] of char;          // name, null terminated
+   end;
+{$else}
    dirent  = record
         d_fileno      : cuint32;                        // file number of entry
         d_reclen      : cuint16;                        // length of this record
@@ -152,6 +162,7 @@ TYPE
         d_namlen      : cuint8;                         // length of string in d_name
         d_name        : array[0..(255 + 1)-1] of char;  // name must be no longer than this
    end;
+{$endif}
 {$else not darwin_new_iostructs}
    {$packrecords 4}
    { available on Mac OS X 10.6 and later, and used by all iPhoneOS versions }