Am 19.03.2023 um 09:36 schrieb Martin Frb via lazarus:
On 19/03/2023 00:00, Michael Van Canneyt via lazarus wrote:

On Sat, 18 Mar 2023, Mattias Gaertner via lazarus wrote:


As this happens seldom there is no detection built in (yet) to handle
this automatically.

If possible, might be a good idea.

Afaik there are 2 scenarios.

1) The duplicate.
The user has the package installed, that now became a base package. So units are used twice.

For this there may be a very simple solution.
- staticpackes is used by lazarus.pp
- So we could add new core-packackage-units to a different unit's use clause. Then they don't appear twice in the same uses clause. E.g. we could add a unit LazCorePackages, and that just contains a uses clause.  It would be used first in the uses of lazarus.pp.

It may also be able to do some trickery with IFDEF.
If core packages are in the lazarus.pp uses clause, appearing only after staticpackages, then there could be {$IF not defined(symbol_from_new_core_unit)}.
Haven't tested that, don't know if it would actually work.

It would not, because FPC loads the units only at the of the uses clause and not once for every unit it finds. This is an incompatibility with Delphi, but currently there's no real desire to change that as it only affects such uses-clause trickery. If it *would* work however you could simply do {$if not declared(name_of_the_unit)}, because the unit name is also a valid symbol.

Regards,
Sven
--
_______________________________________________
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus

Reply via email to