Skip to content

Conversation

@corneliusdavid
Copy link
Contributor

TL;DR: Win64 projects don't list all needed unit scope names.

When trying to compile the Indy libraries for 64-bit, not all unit scope names were defined in the project (couldn't find the Windows or Registry units). Instead of adding unit scope names to every 64-bit package (like they are in the 32-bit packages) for all versions of Delphi (since XE2 when 64-bit compilers were introduced) or requiring Delphi developers to add them to their own Delphi options, just add compiler directives for the handful of places in the source that need it.

I found "VCL_XE2_OR_ABOVE" already defined and convenient so just used that for both Windows and Registry units.

Win64 projects don't list all needed unit scope names
@rlebeau rlebeau added Type: Enhancement Issue is proposing a new feature/enhancement Element: Compiler/IDE Issues related to a particular Compiler and/or IDE labels Nov 4, 2025
@rlebeau
Copy link
Member

rlebeau commented Nov 4, 2025

I can merge this PR as a short-term fix. But, as there is already a handful of places in the code where Unit Scope names are being used explicitly but inconsistently, I might suggest expanding on this change to include all RTL units that use Unit Scope Names, like System.SysUtils, System.IOUtils, System.DateUtils, Vcl.xxx, etc. And add a new compiler define to IdCompilerDefines.inc such as USE_UnitScopeNames for better clarity rather than using VCL_XE2_OR_ABOVE.

@corneliusdavid
Copy link
Contributor Author

That makes good sense. I wouldn't have been surprised if you wanted to change the compiler directive I used in this commit; I found it used for similar purposes elsewhere and it seemed to work so thought if nothing else, I'd bring attention to it. I like USE_UnitScopeNames better.

@rlebeau rlebeau changed the base branch from master to add-unit-scope-names November 4, 2025 20:00
@rlebeau
Copy link
Member

rlebeau commented Nov 4, 2025

I changed the target branch for this PR, as I'm going to make further changes before merging everything into master.

@rlebeau rlebeau merged commit c06d87f into IndySockets:add-unit-scope-names Nov 4, 2025
@corneliusdavid
Copy link
Contributor Author

If you'd like some help making these changes, let me know how you want to go about it and I can put some time into it.

@rlebeau
Copy link
Member

rlebeau commented Nov 5, 2025

I added additional changes to the add-unit-scope-names branch, let me know what you think or if I missed something. It turned out to be a bit more than I expected.

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 Type: Enhancement Issue is proposing a new feature/enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants