[Lazarus] Converting pchar to pcchar

Marco van de Voort marcov at stack.nl
Mon Aug 15 15:19:23 CEST 2011


On Sun, Aug 14, 2011 at 08:30:20PM +0200, Sven Barth wrote:
> If you look into the unit "ctypes" (located in $fpcdir/rtl/inc) you'll 
> see that "ppchar" is defined as "^cchar" and "cchar" is defined as 
> "cint8" which in turn is defined as "shortint". While SizeOf(ShortInt) = 
> SizeOf(Char) is true ("Char" is the base of "PChar"), ShortInt=Char is not.

IIRC originally when I added ctypes, name:pcchar was meant to be the translationfrom "const char*
name".

C const back then translated to nothing (since Pascal CONST was still by ref
then), and it was an attempt to at least register the fact that the
declaration had CONST in C. 

This because some of the problems of "CONST" on
different architectures were already known by then.







More information about the Lazarus mailing list