diff --git a/rtl/inc/system.inc b/rtl/inc/system.inc index 88a70cde5c..30b6406d87 100644 --- a/rtl/inc/system.inc +++ b/rtl/inc/system.inc @@ -2234,7 +2234,7 @@ end; function AtomicCmpExchange(var Target: word; NewValue, Comperand: word): word; {$ifdef SYSTEMINLINE}inline{$endif}; begin - Result:=InterlockedCompareExchange(TargetNewValue, Comperand); + Result:=InterlockedCompareExchange(Target, NewValue, Comperand); end;