Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
migrate my Intraweb 14.0.36_20141215 sources Delphi XE5 to delphi ToKyo 10.2.
#1
Hello,
I need to migrate my Intraweb 14.0.36_20141215 sources Delphi XE5 to delphi ToKyo 10.2.
There are several problems that I would like to solve without hacking.
the first:
Code:
Unit InGlobal
function InterlockedCompareExchangePtr(var VTarget: Pointer; const AValue, Compare: Pointer): Pointer;
{$IFNDEF DYNAMICLOAD_InterlockedCompareExchange}
 {$IFDEF USE_INLINE}inline;{$ENDIF}
{$ENDIF}
begin
 {$IFDEF DYNAMICLOAD_InterlockedCompareExchange}
 Result := Pointer(InGlobal.InterlockedCompareExchange(PtrInt(VTarget), PtrInt(AValue), PtrInt(Compare)));
 {$ELSE}
   {$IFDEF HAS_TInterlocked}
 Result := TInterlocked.CompareExchange(VTarget, AValue, Compare);
   {$ELSE}
     {$IFDEF HAS_InterlockedCompareExchangePointer}<= Comment on définit ?<3>
 Result := InterlockedCompareExchangePointer(VTarget, AValue, Compare); peut-être bon<2>
     {$ELSE}
       {$IFDEF HAS_InterlockedCompareExchange_Pointers}
       //work around a conflicting definition for InterlockedCompareExchange
 Result := {$IFDEF FPC}system.{$ENDIF}InterlockedCompareExchange(VTarget, AValue, Compare);KO< 1>
       {$ELSE}
         {$IFDEF FPC}
 Result := Pointer(
   {$IFDEF CPU64}InterlockedCompareExchange64{$ELSE}InterlockedCompareExchange{$ENDIF}
   (PtrInt(VTarget), PtrInt(AValue), PtrInt(Compare))
    );
         {$ELSE}
 // Delphi 64-bit is handled by HAS_InterlockedCompareExchangePointer
 Result := Pointer(InterlockedCompareExchange(Longint(VTarget), Longint(AValue), Longint(Compare)));
         {$ENDIF}
       {$ENDIF}
     {$ENDIF}
   {$ENDIF}
 {$ENDIF}
end;

<1> KO. I understand
<2> perhaps good
<3> how to force the directive:
Code:
HAS_InterlockedCompareExchangePointer
and is it the good method?

Regards

André Manin
Reply


Messages In This Thread
migrate my Intraweb 14.0.36_20141215 sources Delphi XE5 to delphi ToKyo 10.2. - by André Manin - 04-03-2018, 08:22 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)