Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move mode switch from the interface part of the unit to the area betw… #559

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

JPeterMugaas
Copy link
Contributor

@JPeterMugaas JPeterMugaas commented Nov 21, 2024

…een the "unit" and "interface" for good measure

…een the "unit" and "interface" for good measure

Remove some unneeded unit dependencies.
@rlebeau rlebeau added Type: Enhancement Issue is proposing a new feature/enhancement Element: Compiler/IDE Issues related to a particular Compiler and/or IDE Status: Review Needed Issue needs further review to decide next status labels Nov 21, 2024
@JPeterMugaas
Copy link
Contributor Author

JPeterMugaas commented Nov 21, 2024

I moved the IdCompilerDefines.inc to between the "unit" and "imterface" declarations because of this:

From the Free Pascal Conversion Guide:
https://wiki.lazarus.freepascal.org/Code_Conversion_Guide

Most Delphi units can be compiled by the Free Pascal compiler by adding:

{$IFDEF FPC}
  {$MODE DELPHI}
{$ENDIF}

right after the unit name.

@rlebeau
Copy link
Member

rlebeau commented Nov 22, 2024

Where the IdCompilerDefines.inc references are located right now is fine, they have worked fine for years without problem. They don't need to be moved:

https://www.freepascal.org/docs-html/user/userse33.html

The MODE directive should always be located before the uses clause of the unit interface or program uses clause, because setting the mode may result in the loading of an additional unit as the first unit to be loaded.

Moving the .inc references above the interface block doesn't offer any real benefit, only minor code cleanup. I'm already doing some other code cleanups in Indy 11, so I would defer such a big change until then.

But, removing unused unit references is good. I have incorporated those changes now.

@rlebeau rlebeau added this to the Indy 11 - Maintenance Release milestone Nov 22, 2024
@rlebeau rlebeau added Status: Deferred Issue to be re-reviewed in a future release and removed Status: Review Needed Issue needs further review to decide next status labels Nov 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Element: Compiler/IDE Issues related to a particular Compiler and/or IDE Status: Deferred Issue to be re-reviewed in a future release Type: Enhancement Issue is proposing a new feature/enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants