Forum > FPC development

inline statement for interface definition


Hi folks,

i have an idea....
I currently working on the DirectX Header translations.
Now there are many codes like this one:

--- Code: ---STDMETHOD_(void, GetOutput)(
        _Outptr_ ID2D1Image **outputImage
        ) CONST PURE;
        UINT32 index,
        _In_opt_ ID2D1Effect *inputEffect,
        BOOL invalidate = TRUE
        ID2D1Image *output = NULL;
        if (inputEffect != NULL)
        SetInput(index, output, invalidate);
        if (output != NULL)
--- End code ---
well, the first function (GetOutput) is no problem, a normal definition of a interface function.
but the seconde ( SetInputEffect) is terrible to translate to pascal, no idea how...
if calling this function, in C++ simple the code provided is executed....

So the idea is to add the INLINE function to the interface definition in fpc.

The above could look as:

--- Code: ---procedure GetOutput(
        out outputImage :ID2D1Image
        ); stdcall;
    procedure  SetInputEffect( index:UINT32;
        inputEffect:ID2D1Effect = nil;
         invalidate: boolean = TRUE
        ) ; inline;
--- End code ---

so with the INLINE directive the compiler replaces the call with the provided code (which has to be coded in the implementation section).

is this possible ? since the directive do the same for "normal" functions this should be possible for interfaces too I think, even i'm not a compiler-programer  :D

would be a nice feature  8)

PS: sorry for my bad english  O:-)


[0] Message Index

Go to full version