On 5 Apr 2005 at 21:05, Frank Heckenbach wrote:
Prof A Olowofoyeku (The African Chief) wrote:
On 1 Apr 2005 at 17:32, Frank Heckenbach wrote:
Prof A Olowofoyeku (The African Chief) wrote:
BTW: Delphi has a facility for aliasing units: "-A<unit>=<alias>". I think we discussed this quite a while ago. Does gpc now have this feature,
No, but two (partial) alternatives:
[...]
- Uses propagation (make a unit `Bar' which export everything it imports):
{$propagate-units}
unit Bar;
interface
uses Foo;
implementation
end.
Thanks. This could be a useful workaround. It would be nice to have something like "--unit-alias unitname=aliasname", but it probably isn't a trivial thing to implement ...
Probably not so trivial, since it would affect both GPC (proper), automake and GP.
I thought as much. Not to worry ...
And you didn't really state why you want it.
To avoid endless IFDEFs in USES clauses (and needing to change several source files to achieve this). Probably just a lazy way out - but it is far easier to do: "gpc --automake foo.pas --unit-alias foo2=bar" from the command line than to start to edit any number of source files and change: "USES bar;" to: "USES $ifdef __GPC__} foo2; {$else} bar; {$endif}"
Do you plan to use it regularly for all kinds of units?
Yes, that is how I would use it if it exists.
Or only for a fixed set of units? In the latter case, both alternatives would seem to do as well (the first one with `uses ... in', the second one even without it).
Indeed.
Best regards, The Chief -------- Prof. Abimbola A. Olowofoyeku (The African Chief) web: http://www.greatchief.plus.com/