mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-12 23:09:40 +02:00
Fix system compilation for CPU16
This commit is contained in:
parent
ba2b29bd2c
commit
032158d943
@ -2311,9 +2311,13 @@ function AtomicIncrement (var Target: pointer) : pointer; {$ifdef SYSTEMINLINE}i
|
||||
begin
|
||||
{$IFDEF CPU64}
|
||||
Result:=Pointer(InterlockedIncrement64(int64(Target)));
|
||||
{$ELSE}
|
||||
{$IFDEF CPU16}
|
||||
Result:=Pointer(InterlockedIncrement(smallint(Target)));
|
||||
{$ELSE}
|
||||
Result:=Pointer(InterlockedIncrement(Longint(Target)));
|
||||
{$ENDIF}
|
||||
{$ENDIF}
|
||||
end;
|
||||
|
||||
|
||||
@ -2322,9 +2326,13 @@ function AtomicDecrement (var Target: pointer) : pointer; {$ifdef SYSTEMINLINE}i
|
||||
begin
|
||||
{$IFDEF CPU64}
|
||||
Result:=Pointer(InterlockedDecrement64(Int64(Target)));
|
||||
{$ELSE}
|
||||
{$IFDEF CPU16}
|
||||
Result:=Pointer(InterlockedDecrement(smallint(Target)));
|
||||
{$ELSE}
|
||||
Result:=Pointer(InterlockedDecrement(Longint(Target)));
|
||||
{$ENDIF}
|
||||
{$ENDIF}
|
||||
end;
|
||||
|
||||
|
||||
@ -2333,9 +2341,13 @@ function AtomicCmpExchange(var Target: pointer; NewValue, Comperand: pointer): p
|
||||
begin
|
||||
{$IFDEF CPU64}
|
||||
Result:=Pointer(InterlockedCompareExchange64(Int64(Target),Int64(NewValue), Int64(Comperand)));
|
||||
{$ELSE}
|
||||
{$IFDEF CPU16}
|
||||
Result:=Pointer(InterlockedCompareExchange(smallint(Target),smallint(NewValue),smallint(Comperand)));
|
||||
{$ELSE}
|
||||
Result:=Pointer(InterlockedCompareExchange(LongInt(Target),LongInt(NewValue), LongInt(Comperand)));
|
||||
{$ENDIF}
|
||||
{$ENDIF}
|
||||
end;
|
||||
|
||||
|
||||
@ -2344,9 +2356,13 @@ function AtomicExchange(var Target: pointer;Source : pointer) : pointer; {$ifdef
|
||||
begin
|
||||
{$IFDEF CPU64}
|
||||
Result:=Pointer(InterlockedExchange64(Int64(Target),Int64(Source)));
|
||||
{$ELSE}
|
||||
{$IFDEF CPU16}
|
||||
Result:=Pointer(InterlockedExchange(smallint(Target),smallint(Source)));
|
||||
{$ELSE}
|
||||
Result:=Pointer(InterlockedExchange(LongInt(Target),LongInt(Source)));
|
||||
{$ENDIF}
|
||||
{$ENDIF}
|
||||
end;
|
||||
|
||||
function AtomicIncrement (var Target: Cardinal) : Cardinal; {$ifdef SYSTEMINLINE}inline{$endif};
|
||||
|
Loading…
Reference in New Issue
Block a user