changes to fix Lazarus and FreePascal compilation issues. by norayr · Pull Request #413 · lmbelo/python4delphi

NewSize := Utf8ToUnicode(PUnicodeChar(Result), Cardinal(Size + 1), Buffer, Cardinal(Size));
{$ELSE}
NewSize := Utf8ToUnicode(PChar(Result), Cardinal(Size + 1), Buffer, Cardinal(Size));
{$ENDIF}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NewSize := Utf8ToUnicode(PWideChar(Result), Cardinal(Size + 1), Buffer, Cardinal(Size));

Would work both in Delphi and Fpc.
PUnicodeChar is an alias to PWideChar;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

true!

{$ENDIF}
{$IFDEF FPC}
DelphiObject := TResourceStreamClass(DelphiObjectClass).Create(LHandle, String(LResName), PChar(String(LResType)))
{$ELSE}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DelphiObject := TResourceStreamClass(DelphiObjectClass).Create(LHandle, String(LResName), PChar(String(LResType)))

Should work in both fpc and Delphi.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

{$ENDIF}
{$IFDEF FPC}
DelphiObject := TResourceStreamClass(DelphiObjectClass).CreateFromID(LHandle, LResId, PChar(String(LResType)));
{$ELSE}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

PyType: PPyTypeObject;
{$IFDEF FPC}
i: longint;
{$ENDIF}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i: Integer
should be in the {$ELSE} part of the the IFDEF below.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done!

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe I addressed all the comments.

Thank you for those. You can take a look at another commit.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I meant in the ELSE part of EXTENDED_RTTI! You don't need IFDEF FPC. And use Integer instead of longint.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh, now I see.

Thank you for comments and your patience.

Now I did it, but PR contains 3 commits.

Do you want me to figure the way to change it for 1 commit?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so, do you like the current state of it?
would you merge? or should i change something else?