[fpc-devel] QueryInterface on linux/i386 - adding 'in' parameter type?
Marco van de Voort
marcov at stack.nl
Sun Aug 29 16:23:48 CEST 2010
In our previous episode, Michael Van Canneyt said:
> Because if it is something we decided, it simply means that we should change
> it's meaning to be identical to mwpascal: cdecl calling convention, and const
> structs passed by reference. If I'm right, 'stdcall' currently
> has no meaning on non-windows platforms other than the one we put on it.
mwpascal is still per declaration and Delphi incompatible. And keep in mind
that any implementation of a IUnknown must repeat any modifiers in the
original source (including const ref and calling conventions) regardless of
what option is chosen.
That also goes for directives, but, if selective enough (e.g. for calling
convention) modifier, they can be unit global, or even in practice
application global (includefile)
> If that is not possible, then I think Marco's idea of a switch is best.
> I see it as similar to the {$packrecords } directive: it doesn't change the
> syntax or meaning (as Jonas fears), but does instruct the compiler how to
> handle things on a more low-level (in casu: assembler) scale.
Good analogy, exactly what I meant:
1. more variants possible
2. not per declaration individually.
> I think that having to write {$ifdef windows}const{$else}constref{$endif}
> myarg: mytype
> for possibly thousands of arguments in an interface description is simply not
> an option.
Note that I don't 100% surely know if this will happen in this particular
case, specially if safecall meaning is modified. (IOW Jonas wants to do that
to avoid this)
It is just that a $switch will give some leeway in the future for similar
cases.
More information about the fpc-devel
mailing list