compiling stdwin port x11 on X11R5 ... and XLIB_ILLEGAL_ACCESS define ...

John Gmuender (gum@hal.com)
Mon, 25 Oct 93 3:30:31 PDT

Hi there:

I was just trying to add stdwin module to python and ran into
this snag when compiling stdwin ...

% make
cc -c -I/tmp_mnt/sim/gumtools/src/python/stdwin/H -g /tmp_mnt/sim/gumtools/src/python/stdwin/Ports/x11/font.c
"/tmp_mnt/sim/gumtools/src/python/stdwin/Ports/x11/font.c", line 117: gid undefined

which comes from this code snippet ....

...
if (stdfont.name == NULL) {
stdfont.info= XQueryFont(_wd, DefaultGCOfScreen(_ws)->gid);
if (stdfont.info == NULL)
_wfatal("_winitfonts: no server default font");
stdfont.info->fid= 0;
}
...

So, I started looking through everything and figured out that
X11R5 Xlib.h (as opposed to X11R4 Xlib.h), requires the define

XLIB_ILLEGAL_ACCESS

in order to reach into the GC and grab the gid.

I happily added this to the CFLAGS of the Makefile ...

CFLAGS= $(CPPFLAGS) $(OPTS) -DXLIB_ILLEGAL_ACCESS

and wholla ... it compiles!

Of course, this has probably been figured out fifty times before ...
I thought I would relate it anyway.

Now, on to adding stdwin to python :)
--__ ____
/_//_// / /
__/ gum@hal.com