{$MODE FPC}
{$MODESWITCH DEFAULTPARAMETERS}
{$MODESWITCH OUT}
{$MODESWITCH RESULT}
unit dlittleendian;

interface

type
TLittleEndian = object
public type
  Integer = type Integer;
  LongInt = type LongInt;
end;

operator := (I: TLittleEndian.Integer): Integer; inline;
operator := (I: TLittleEndian.LongInt): LongInt; inline;
operator := (I: Integer): TLittleEndian.Integer; inline;
operator := (I: LongInt): TLittleEndian.LongInt; inline;

implementation

operator := (I: TLittleEndian.Integer): Integer;
begin
  Result := {$IFDEF ENDIAN_BIG}SwapEndian{$ENDIF}(I);
end;

operator := (I: TLittleEndian.LongInt): LongInt;
begin
  Result := {$IFDEF ENDIAN_BIG}SwapEndian{$ENDIF}(I);
end;

operator := (I: Integer): TLittleEndian.Integer;
begin
  Result := {$IFDEF ENDIAN_BIG}SwapEndian{$ENDIF}(I);
end;

operator := (I: LongInt): TLittleEndian.LongInt;
begin
  Result := {$IFDEF ENDIAN_BIG}SwapEndian{$ENDIF}(I);
end;

end.
