Skip to content

Conversation

MWASoftware
Copy link

This pull requests removes the out-of-date "getIndy.sh" and replaces it with a set of lazarus packages in the new subdir "lazarus-fpc". This packages have the same structure as the Delphi packages and do not require any changes to the source tree to be
used.
Makefile.fpc files are also provided for use with fpcmake.

See README.lazarus-fpc for more information.

There are also some minor patches to the source files in order to ensure that they can be compiled with FPC.


{$I IdCompilerDefines.inc}

{$IFDEF WINDOWS}
Copy link
Member

Choose a reason for hiding this comment

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

IdWship6 is a Windows-only unit. It should not be compiled in other platforms. This check is redundant.

Copy link
Author

Choose a reason for hiding this comment

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

Lazarus/fpc is a cross-platform write once environment and has a substantial number of Windows users. It is wrong to exclude a unit from a Lazarus package on the grounds that it can only be used in Windows.

Conditional compilation within the unit is the simplest way of allowing platform specific code to be part of a unit. The Lazarus IDE maintains package units automatically and platform specific units cannot be readily included in a package whilst compiling them only when the package is compiled on their target platform.

IdBaseComponent, IdComponent, IdCTypes, IdException, IdGlobal, IdIDN,
IdResourceStrings, IdResourceStringsDotNet11, IdResourceStringsIconv,
IdResourceStringsKylixCompat, IdResourceStringsTextEncoding,
IdResourceStringsUnix, IdResourceStringsVCLPosix, IdStack, IdStackBSDBase,
Copy link
Member

@rlebeau rlebeau Jan 8, 2025

Choose a reason for hiding this comment

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

VCLPosix is for Delphi only. FreePascal should not be compiling Indy's VCLPosix units. Also, FreePascal should not be compiling Unix units on Windows, and vice versa.

Copy link
Author

Choose a reason for hiding this comment

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

I can confirm that removing the VCLPosix units does not seem to affect the Lazarus packages on Linux or Windows and have removed them from the lazarus packages on my Indy10-7 branch.

IdResourceStringsKylixCompat, IdResourceStringsTextEncoding,
IdResourceStringsUnix, IdResourceStringsVCLPosix, IdStack, IdStackBSDBase,
IdStackConsts, IdStream, IdStreamVCL, IdStruct, IdTransactedFileStream,
IdVCLPosixSupplemental, IdWinsock2, IdWship6, IdAntiFreezeBase,
Copy link
Member

@rlebeau rlebeau Jan 8, 2025

Choose a reason for hiding this comment

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

IdWinsock2 and IdWship6 should not be compiled on non-Windows platforms. And Posix units should not be compiled on Windows.

@MWASoftware
Copy link
Author

I have brought the Indy-10.7 branch in my repo up-to-date and tested. Note: I found an error in the merge changes from your upstream repo - a missing parameter in Lib/Core/IdDsnBaseCmpEdt.pas in a call to showaboutbox. I had to fix this to compile and test - hopefully added the correct param value.

If you do merge my changes in, I suggest you add "-s recursive -X renormalize" to git merge e.g.

git merge <my repo>/Indy-10.7 -s recursive -X renormalize

The reason for this is that I am working on Linux and some files have LF endings instead of CR/LF. See the .gitattributes file.

@rlebeau
Copy link
Member

rlebeau commented Sep 20, 2025

Note: I found an error in the merge changes from your upstream repo - a missing parameter in Lib/Core/IdDsnBaseCmpEdt.pas in a call to showaboutbox. I had to fix this to compile and test - hopefully added the correct param value.

IdDsnBaseCmpEdt.pas is a dead unit, it hasn't been touched in 15 years, and nothing in Indy refers to it. It should be removed from the repo. The current About dialog is shown in IdCoreDsnRegister.pas, which calls TfrmAbout.ShowDlg(), which calls ShowAboutBox() with the correct 3 parameter values.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants