[fpc-devel] Armel problems

Michael Schnell mschnell at lumino.de
Wed May 19 10:18:53 CEST 2010


On 05/18/2010 06:51 PM, Den Jean wrote:
> Note how I say c-functions and not c++ functions. 
OK, But your code is

procedure of object;CDecl;

i.e. using a C ABI for a class function.

If the compiler does digest this, the meaning supposedly is that the
procedure gets an additional, supposedly first, parameter (hidden in
Object Pascal, open in C, that is the self pointer of the instance. If
the C programmer knows how to deal with the Pascal object model which of
course he can, as FPC is open source, he in fact can make use of this.

A variable of this type in fact consists of two pointers (code and
self). This is part of the FPC Object model and ABI, so again, the C
programmer can use this kind of variables if he wants to. The
representation in C for such a variable would be a struct of the two
pointers.

But of course all this is only relevant if the C code (e.g. a shared
object) is done with the FPC object model in mind, but not usable to
handle foreign objects (done in C) with FPC code.

-Michael



More information about the fpc-devel mailing list