[fpc-devel] QueryInterface on linux/i386 - adding 'in' parameter type?

Marco van de Voort marcov at stack.nl
Sun Aug 29 17:15:02 CEST 2010

In our previous episode, Michael Van Canneyt said:

> His change would mean that the GCC compiler does things which we currently 
> know nothing about, namely it pushes const parameters by reference in some 
> cases. In casu: What is the C declaration for the QueryInterface call ?
> It is defined in FPC as:
> function QueryInterface(const iid : tguid;out obj) : longint;stdcall;
> But what is QueryInterface as defined in C ? Does C have a tguid type ?
> These questions should be answered prior to changing anything in the compiler.

Afaik in the SDK there is some macro REFIID, even on IDL level.

which is define in the MS SDK as

#ifdef __cplusplus
#define REFIID const IID &
#define REFIID const IID * __MIDL_CONST

and mingw seems to follow that more or less, if I understand the murky code
a bit.

In other words, by value semantics (const TGUID and not PGUID) is a borland

So looking to GCC or even MSVC won't help us here. At least not in the
obvious place (the iunknown declaration, I checked it is same in SDK and
mingw w32api)

More information about the fpc-devel mailing list