dwsJSONConnector does not compile in D2010

Issue #13 resolved
Former user created an issue

There's only one function that fails to compile. Thus, I think it can still be supported:

function TBoxedJSONValue.QueryInterface({$IFDEF FPC_HAS_CONSTREF}constref{$ELSE}const{$ENDIF} IID: TGUID; out Obj): HResult; begin if IID=IBoxedJSONValue then begin //<-- Error on this line PIUnknown(@Obj)^:=IBoxedJSONValue(Self); Result:=0; end else Result:=inherited QueryInterface(IID, Obj); end;

[DCC Error] dwsJSONConnector.pas(319): E2015 Operator not applicable to this operand type

Comments (4)

  1. Eric Grange repo owner

    I do not have D2010 around anymore, what alternative code would be supported in that version?

  2. Gael Momo

    I have the same problem. I commented the function and just left inherited. Seems to work fine so far .. Would be nice to have a suggestion. REgards

  3. Alexey Kazantsev

    Patch:

    diff --git a/Source/dwsJSONConnector.pas b/Source/dwsJSONConnector.pas
    index 9af2085..8591ba6 100644
    --- a/Source/dwsJSONConnector.pas
    +++ b/Source/dwsJSONConnector.pas
    @@ -316,7 +316,7 @@ end;
     //
     function TBoxedJSONValue.QueryInterface({$IFDEF FPC_HAS_CONSTREF}constref{$ELSE}const{$ENDIF} IID: TGUID; out Obj): HResult;
     begin
    -   if IID=IBoxedJSONValue then begin
    +   if IsEqualGUID(IID, IBoxedJSONValue) then begin
           PIUnknown(@Obj)^:=IBoxedJSONValue(Self);
           Result:=0;
        end else Result:=inherited QueryInterface(IID, Obj);
    
  4. Log in to comment