+ added a define FINDHANDLE_IS_POINTER that indicates that on the current

platform SysUtils.TSearchRec.FileHandle is a Pointer, instead of THandle.
  I didn't introduce a TFindHandle type, because I didn't want to add yet
  another publicly visible type in the SysUtils interface.

git-svn-id: trunk@28449 -
This commit is contained in:
nickysn 2014-08-18 21:20:07 +00:00
parent fee1632b42
commit f5c1751be5
2 changed files with 8 additions and 7 deletions

View File

@ -433,11 +433,9 @@ type
indication enough that you should not touch it }
Name_do_not_touch : RawByteString;
ExcludeAttr : Longint;
FindHandle : {$ifdef FINDHANDLE_IS_POINTER}Pointer{$else}THandle{$endif};
{$ifdef unix}
FindHandle : Pointer;
Mode : TMode;
{$else unix}
FindHandle : THandle;
{$endif unix}
{$ifdef USEFINDDATA}
FindData : TFindData;
@ -455,7 +453,7 @@ Function InternalFindFirst (Const Path : UnicodeString; Attr : Longint; out Rslt
Function InternalFindNext (var Rslt : TAbstractSearchRec; var Name : UnicodeString) : Longint; forward;
{$endif SYSUTILS_HAS_UNICODESTR_FILEUTIL_IMPL}
procedure InternalFindClose(var Handle: {$ifdef unix}Pointer{$else}THandle{$endif}{$ifdef USEFINDDATA};var FindData: TFindData{$endif}); forward;
procedure InternalFindClose(var Handle: {$ifdef FINDHANDLE_IS_POINTER}Pointer{$else}THandle{$endif}{$ifdef USEFINDDATA};var FindData: TFindData{$endif}); forward;
{$ifndef SYSUTILS_HAS_ANSISTR_FILEUTIL_IMPL}

View File

@ -16,6 +16,11 @@
Type
// Some operating systems need FindHandle to be a Pointer
{$if defined(unix)}
{$define FINDHANDLE_IS_POINTER}
{$endif}
// Some operating systems need extra find data.
{$if defined(Win32) or defined(WinCE) or defined(Win64)}
{$define USEFINDDATA}
@ -62,11 +67,9 @@ Type
Attr : Longint;
Name : RawByteString;
ExcludeAttr : Longint;
FindHandle : {$ifdef FINDHANDLE_IS_POINTER}Pointer{$else}THandle{$endif};
{$ifdef unix}
FindHandle : Pointer;
Mode : TMode;
{$else unix}
FindHandle : THandle;
{$endif unix}
{$IFDEF USEFINDDATA}
FindData : TFindData;