* several 64 bit issues fixed

This commit is contained in:
florian 2004-02-22 16:48:39 +00:00
parent 0c35b6f3c4
commit 934fe41c45
5 changed files with 65 additions and 38 deletions

View File

@ -339,7 +339,7 @@ begin
else
ambig:=true;
end;
inc(longint(p),sizeof(toption));
inc(pointer(p),sizeof(toption));
inc(option_index);
end;
if ambig and not exact then
@ -506,7 +506,10 @@ begin
end.
{
$Log$
Revision 1.5 2002-11-20 14:31:22 jonas
Revision 1.6 2004-02-22 16:48:39 florian
* several 64 bit issues fixed
Revision 1.5 2002/11/20 14:31:22 jonas
* applied fix from Maxim Artemev (bert_raccoon@freemail.ru)
Revision 1.4 2002/03/28 20:54:25 carl

View File

@ -41,18 +41,18 @@ Var
{*****************************************************************************
Overloaded functions
*****************************************************************************}
{$ifndef CPU64}
function BeginThread(sa : Pointer;stacksize : dword;
ThreadFunction : tthreadfunc;p : pointer;creationFlags : dword;
var ThreadId : Longint) : DWord;
begin
BeginThread:=BeginThread(nil,StackSize,ThreadFunction,p,creationFlags,Dword(THreadId));
BeginThread:=BeginThread(nil,StackSize,ThreadFunction,p,creationFlags,THandle(THreadId));
end;
{$endif CPU64}
function BeginThread(ThreadFunction : tthreadfunc) : DWord;
var
dummy : dword;
dummy : THandle;
begin
BeginThread:=BeginThread(nil,DefaultStackSize,ThreadFunction,nil,0,dummy);
end;
@ -60,30 +60,31 @@ Var
function BeginThread(ThreadFunction : tthreadfunc;p : pointer) : DWord;
var
dummy : dword;
dummy : THandle;
begin
BeginThread:=BeginThread(nil,DefaultStackSize,ThreadFunction,p,0,dummy);
end;
function BeginThread(ThreadFunction : tthreadfunc;p : pointer;var ThreadId : DWord) : DWord;
function BeginThread(ThreadFunction : tthreadfunc;p : pointer;var ThreadId : THandle) : DWord;
begin
BeginThread:=BeginThread(nil,DefaultStackSize,ThreadFunction,p,0,ThreadId);
end;
{$ifndef CPU64}
function BeginThread(ThreadFunction : tthreadfunc;p : pointer;var ThreadId : Longint) : DWord;
begin
BeginThread:=BeginThread(nil,DefaultStackSize,ThreadFunction,p,0,Dword(ThreadId));
BeginThread:=BeginThread(nil,DefaultStackSize,ThreadFunction,p,0,THandle(ThreadId));
end;
{$endif CPU64}
procedure EndThread;
begin
EndThread(0);
end;
function BeginThread(sa : Pointer;stacksize : dword; ThreadFunction : tthreadfunc;p : pointer;creationFlags : dword; var ThreadId : DWord) : DWord;
function BeginThread(sa : Pointer;stacksize : dword; ThreadFunction : tthreadfunc;p : pointer;creationFlags : dword; var ThreadId : THandle) : DWord;
begin
Result:=CurrentTM.BeginThread(sa,stacksize,threadfunction,P,creationflags,ThreadID);
@ -216,7 +217,7 @@ end;
function NoBeginThread(sa : Pointer;stacksize : dword;
ThreadFunction : tthreadfunc;p : pointer;
creationFlags : dword; var ThreadId : DWord) : DWord;
creationFlags : dword; var ThreadId : THandle) : DWord;
begin
NoThreadError;
end;
@ -322,7 +323,10 @@ end;
{
$Log$
Revision 1.8 2004-01-21 20:11:06 peter
Revision 1.9 2004-02-22 16:48:39 florian
* several 64 bit issues fixed
Revision 1.8 2004/01/21 20:11:06 peter
* fixed compile for unix
Revision 1.7 2004/01/20 23:13:53 hajny

View File

@ -23,7 +23,7 @@ type
TThreadFunc = function(parameter : pointer) : longint;
// Function prototypes for TThreadManager Record.
TBeginThreadHandler = Function (sa : Pointer;stacksize : dword; ThreadFunction : tthreadfunc;p : pointer;creationFlags : dword; var ThreadId : DWord) : DWord;
TBeginThreadHandler = Function (sa : Pointer;stacksize : dword; ThreadFunction : tthreadfunc;p : pointer;creationFlags : dword; var ThreadId : THandle) : DWord;
TEndThreadHandler = Procedure (ExitCode : DWord);
// Used for Suspend/Resume/Kill
TThreadHandler = Function (threadHandle : dword) : dword;
@ -83,18 +83,22 @@ procedure InitThread(stklen:cardinal);
function BeginThread(sa : Pointer;stacksize : dword;
ThreadFunction : tthreadfunc;p : pointer;creationFlags : dword;
var ThreadId : DWord) : DWord;
var ThreadId : THandle) : DWord;
{$ifndef CPU64}
{ Delphi uses a longint for threadid }
function BeginThread(sa : Pointer;stacksize : dword;
ThreadFunction : tthreadfunc;p : pointer;creationFlags : dword;
var ThreadId : Longint) : DWord;
{$endif CPU64}
{ add some simplfied forms which make lifer easier and porting }
{ to other OSes too ... }
function BeginThread(ThreadFunction : tthreadfunc) : DWord;
function BeginThread(ThreadFunction : tthreadfunc;p : pointer) : DWord;
function BeginThread(ThreadFunction : tthreadfunc;p : pointer; var ThreadId : DWord) : DWord;
function BeginThread(ThreadFunction : tthreadfunc;p : pointer; var ThreadId : THandle) : DWord;
{$ifndef CPU64}
function BeginThread(ThreadFunction : tthreadfunc;p : pointer; var ThreadId : Longint) : DWord;
{$endif CPU64}
procedure EndThread(ExitCode : DWord);
procedure EndThread;
@ -120,7 +124,10 @@ procedure LeaveCriticalsection(var cs : TRTLCriticalSection);
{
$Log$
Revision 1.14 2003-11-29 17:29:32 michael
Revision 1.15 2004-02-22 16:48:39 florian
* several 64 bit issues fixed
Revision 1.14 2003/11/29 17:29:32 michael
+ Added overloaded version of SetThreadManager without old parameter
Revision 1.13 2003/11/27 10:28:41 michael

View File

@ -226,6 +226,7 @@ Procedure SetVariantProp(Instance: TObject; PropInfo : PPropInfo; const Value: V
Function GetObjectProp(Instance: TObject; const PropName: string): TObject;
Function GetObjectProp(Instance: TObject; const PropName: string; MinClass: TClass): TObject;
Function GetObjectProp(Instance: TObject; PropInfo: PPropInfo): TObject;
Function GetObjectProp(Instance: TObject; PropInfo: PPropInfo; MinClass: TClass): TObject;
Procedure SetObjectProp(Instance: TObject; const PropName: string; Value: TObject);
Procedure SetObjectProp(Instance: TObject; PropInfo: PPropInfo; Value: TObject);
@ -786,6 +787,12 @@ begin
end;
Function GetObjectProp(Instance: TObject; PropInfo : PPropInfo): TObject;
begin
Result:=GetObjectProp(Instance,PropInfo,Nil);
end;
Function GetObjectProp(Instance: TObject; PropInfo : PPropInfo; MinClass: TClass): TObject;
begin
{$ifdef cpu64}
@ -1315,7 +1322,10 @@ end;
end.
{
$Log$
Revision 1.22 2004-02-21 22:53:49 florian
Revision 1.23 2004-02-22 16:48:39 florian
* several 64 bit issues fixed
Revision 1.22 2004/02/21 22:53:49 florian
* several 64 bit/x86-64 fixes
Revision 1.21 2004/02/20 15:55:26 peter

View File

@ -166,7 +166,7 @@ Uses
function CBeginThread(sa : Pointer;stacksize : dword;
ThreadFunction : tthreadfunc;p : pointer;
creationFlags : dword; var ThreadId : DWord) : DWord;
creationFlags : dword; var ThreadId : THandle) : DWord;
var
ti : pthreadinfo;
thread_attr : pthread_attr_t;
@ -414,7 +414,10 @@ initialization
end.
{
$Log$
Revision 1.8 2004-02-15 16:33:32 marco
Revision 1.9 2004-02-22 16:48:39 florian
* several 64 bit issues fixed
Revision 1.8 2004/02/15 16:33:32 marco
* linklibs fixed for new pthread mechanism on FreeBSD
Revision 1.7 2004/01/20 23:13:53 hajny