Subject | Re: [firebird-support] How to declare a UDF function in Delphi (cdecl |
---|---|
Author | Adriano dos Santos Fernandes |
Post date | 2008-08-08T16:11:36Z |
Milan Babuskov escreveu:
task to the caller. You cannot have stdcall function with variable
number of parameters.
FB calls the UDF passing the max number of allowed parameters, and not
only the number of parameters declared. Otherwise it would need
hardcoded calls to function with 1, 2, 3, etc number of parameters or
generate assembly on the fly.
Adriano
> Hi Carlos,stdcall functions restore the stack while cdecl functions leave this
>
> Carlos H. Cantu (TeamFB) wrote:
>> I> Can somebody help and say what is the right kind of declaration?
>>
>> Copying Dmitry Yemanov words:
>>
>> Unlike what the original IB documentation says, the calling convention
>> should be "cdecl" instead of "stdcall".
>
> any more info on why 'cdecl' should be used?
>
task to the caller. You cannot have stdcall function with variable
number of parameters.
FB calls the UDF passing the max number of allowed parameters, and not
only the number of parameters declared. Otherwise it would need
hardcoded calls to function with 1, 2, 3, etc number of parameters or
generate assembly on the fly.
Adriano