[Lazarus] Converting pchar to pcchar

Marco van de Voort marcov at stack.nl
Tue Aug 16 10:47:12 CEST 2011


On Mon, Aug 15, 2011 at 06:22:43PM +0200, Hans-Peter Diettrich wrote:
> Marco van de Voort schrieb:
> > 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
> > translation from "const char* name".
> 
> AFAIR Windows.h defined PCCHAR this way, and PTCHAR as platform 
> specific, i.e. PCHAR on Win16 and PWCHAR on Win32. Even combinations of 
> T and C modifiers had been defined, e.g. PTCCHAR.

At that time, ctypes was still Unix only. It used to be the first part of
what is now "ptypes.inc" in the rtl. Since more and more header units
started using it (and some headers were also used on Windows) it was spun
out as a separate unit.
 
So windows headers have nothing to do with it.




More information about the Lazarus mailing list