On 2012-09-25 22:16, Henry Vermaak wrote:> I've used a macro for this in the past. E.g. :
Show quoted text 9 lines
Couldn't something like this be applied to IInterface too? So we can get rid of those horrible IFDEF lines. If you don't know what I am talking about, have a look at the IInterface definition.
IUnknown = interface
['{00000000-0000-0000-C000-000000000046}']
function QueryInterface({$IFDEF
FPC_HAS_CONSTREF}constref{$ELSE}const{$ENDIF} iid : tguid;out obj) :
longint;{$IFNDEF WINDOWS}cdecl{$ELSE}stdcall{$ENDIF};
function _AddRef : longint;{$IFNDEF
WINDOWS}cdecl{$ELSE}stdcall{$ENDIF};
function _Release : longint;{$IFNDEF
WINDOWS}cdecl{$ELSE}stdcall{$ENDIF};
end;
IInterface = IUnknown;And all those IFDEF's must go in your own code too when you implement a class with IInterface support. Yuck!!
Cheers,
- Graeme -
