[fpc-devel] Proposal: Supporting initial references for weakexternal

Paul Ishenin ip at kmiac.ru
Wed Jan 12 06:56:17 CET 2011


12.01.2011 12:29, Jeppe Johansen wrote:
> A short example:
> procedure NoHandler;
> begin
> end;
>
> procedure TestProc; weakexternal name 'TestProc' set 'NoHandler';
> ...
> begin
> TestProc; // This will call NoHandler
> end.
>
> If we modify the example:
> procedure NoHandler;
> begin
> end;
>
> procedure TestProcHandler; [public, alias: 'TestProc'];
> begin
> end;
>
> procedure TestProc; weakexternal name 'TestProc' set 'NoHandler';
> ...
> begin
> TestProc; // This will call TestProcHandler
> end.

As I understand NoHandler will be called if we call a TestProc routine 
but 'TestProc' symbol is is not found?

If so then:
a) NoHandler must have the same arguments and calling convention as 
TestProc?
b) What happen if NoHandler is not found?

Best regards,
Paul Ishenin




More information about the fpc-devel mailing list