[fpc-devel] Using Macros for IInterface

michael.vancanneyt at wisa.be michael.vancanneyt at wisa.be
Wed Sep 26 12:37:42 CEST 2012



On Wed, 26 Sep 2012, Sven Barth wrote:

> Am 26.09.2012 12:28, schrieb Marco van de Voort:
>> In our previous episode, Sven Barth said:
>>>>          end;
>>>>          IInterface = IUnknown;
>>> 
>>> This depends on whether we want to enable $macro in the system unit...
>> 
>> It doesn't work at all since macro's don't export over unit borders.
>> 
>
> Nowhere did I mention that it needs to be exported... that's why I thought of 
> the following as a "convention".
>
>>> My suggestions (if we do indeed enable it):
>>> intfconst for constref/const
>>> intfdecl for stdcall/cdecl {I would not use extdecl so that there are no
>>> potential conflicts}
>> 
>> libcall was already mentioned. It also helps in a lot of other places, and
>> kills ninetynine percent of macro use. (which IMHO is always a good thing)
>
> The question is then whether this should indeed be a new calling convention 
> or merely something that translates to stdcall/cdecl...

I would be in favour of handling it at the level of the parser, but
simply translate to cdecl/stdcall. 
I would not use a macro that is handled on the level of the scanner.

The parser has more info at it's disposal, which could be useful if the 
behaviour needs to be refined.

Michael.



More information about the fpc-devel mailing list