[fpc-devel]x11 fix (and a "feature" in h2pas)

Michael Van Canneyt michael.vancanneyt at wisa.be
Wed Jul 30 15:41:23 CEST 2003


On Wed, 30 Jul 2003, Nikolay Nikolov wrote:

> I already sent this message to the fpc-devel list (3 days ago), but I
> still haven't seen it being delievered, so I'm sending it again...
>
>
>
> Basically the X11 package doesn't work. The reason is h2pas. It converts
>    typedef char* XPointer;
> to
>    type TXPointer = char;
>
> That (of course) leads to some very nasty effects, such as different
> sizes of structs (since sizeof(pchar) is 4 and sizeof(char) is 1) and
> all the bad things resulting from that. e.g. even ScreenOfDisplay
> doesn't work - it is actually a macro that accesses
> PXPrivDisplay(dpy)^.screens[scr] and of course TXPrivDisplay is
> incorrect... :)
>
> I can't fix h2pas, but I'm attaching diffs for the X11 units - x, xlib
> and xutil. I also included a translation of the X11 keysymdefs and
> implemented the macros properly in xlib and xutil, so that programming
> for raw X with fpc, isn't more terrible than programming for raw X with gcc.
>
> The new keysym unit has to be added to the makefiles or it has to be
> converted to an include file, and included in the xlib unit. BTW isn't
> it better to merge the X, Xlib and Xutil units into only one unit - Xlib?
>
> I changed a few types to what I think is more correct. (e.g. from char
> to byte, etc.) Hope that doesn't break the units from the other packages
> that use xlib. (but it shouldn't, as the changes are few)

Thank you very much for these fixes.
I have applied the patches, and added keysym to the Makefile.

Michael.





More information about the fpc-devel mailing list