Skip to content

Commit

Permalink
Method reflection partial support for FPC
Browse files Browse the repository at this point in the history
  • Loading branch information
andot committed Jul 31, 2016
1 parent 67c6e49 commit 73beea9
Show file tree
Hide file tree
Showing 4 changed files with 177 additions and 98 deletions.
24 changes: 14 additions & 10 deletions Lazarus/HproseSyna.lpk
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
"/>
<Version Major="1" Minor="4"/>
<Files Count="19">
<Files Count="20">
<Item1>
<Filename Value="..\Source\Synapse\jedi.inc"/>
<Type Value="Include"/>
Expand Down Expand Up @@ -95,26 +95,30 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
<Type Value="Include"/>
</Item14>
<Item15>
<Filename Value="..\Source\HproseCommon.pas"/>
<UnitName Value="HproseCommon"/>
<Filename Value="..\Source\ObjAutoX.pas"/>
<UnitName Value="ObjAutoX"/>
</Item15>
<Item16>
<Filename Value="..\Source\HproseIO.pas"/>
<UnitName Value="HproseIO"/>
<Filename Value="..\Source\HproseCommon.pas"/>
<UnitName Value="HproseCommon"/>
</Item16>
<Item17>
<Filename Value="..\Source\HproseClient.pas"/>
<UnitName Value="HproseClient"/>
<Filename Value="..\Source\HproseIO.pas"/>
<UnitName Value="HproseIO"/>
</Item17>
<Item18>
<Filename Value="..\Source\HproseClient.pas"/>
<UnitName Value="HproseClient"/>
</Item18>
<Item19>
<Filename Value="..\Source\Synapse\HproseHttpClient.pas"/>
<HasRegisterProc Value="True"/>
<UnitName Value="HproseHttpClient"/>
</Item18>
<Item19>
</Item19>
<Item20>
<Filename Value="Hprose.lrs"/>
<Type Value="LRS"/>
</Item19>
</Item20>
</Files>
<RequiredPkgs Count="2">
<Item1>
Expand Down
2 changes: 2 additions & 0 deletions Source/Hprose.inc
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@

{$ifdef DELPHI2010_UP}
{$define Supports_Rtti}
{$define Supports_Rtti2}
{$endif}

{$ifdef DELPHIXE3_UP}
Expand All @@ -199,6 +200,7 @@

{$ifdef FPC}
{$define Supports_UInt64}
{$define Supports_Rtti2}
{$mode objfpc}
{$inline on}
{$H+}
Expand Down
4 changes: 2 additions & 2 deletions Source/HproseCommon.pas
Original file line number Diff line number Diff line change
Expand Up @@ -859,7 +859,7 @@ implementation
{$IFNDEF FPC}, StrUtils{$ENDIF}
{$IFDEF DELPHIXE4_UP}{$IFNDEF NEXTGEN}, AnsiStrings{$ENDIF}{$ENDIF}
{$IFDEF Supports_Rtti}, Rtti{$ENDIF}{$IFDEF DELPHIXE2_UP}, ObjAuto{$ENDIF}
{$IFNDEF FPC}, ObjAutoX{$ENDIF};
{$IFDEF DELPHI7_UP}, ObjAutoX{$ENDIF};

type

Expand Down Expand Up @@ -4203,7 +4203,7 @@ function TVarObjectType.DoFunction(var Dest: TVarData; const V: TVarData;
Variant(Dest) := Intf.Invoke(Name, Arguments);
end
else begin
{$IFNDEF FPC}
{$IFDEF DELPHI7_UP}
Result := GetMethodInfo(Obj, Name) <> nil;
if Result then Variant(Dest) := ObjectInvoke(Obj, Name, TVariants(Arguments));
{$ELSE}
Expand Down
Loading

0 comments on commit 73beea9

Please sign in to comment.