Prof A Olowofoyeku (The African Chief) wrote:
On 5 Apr 2005 at 21:05, Frank Heckenbach wrote:
Prof A Olowofoyeku (The African Chief) wrote:
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}"
Well, you still don't say why the unit needs to be called differently in the first place.
Aside from the two other solutions (actually I don't really consider them work-arounds -- after all, if you want to import an interface called `foo2', it seems reasonable to export it as such, which both ways do), one could define a macro on the command-line which would also apply to `uses' clauses (but I'd rather consider that a work-around).
Frank