[MPlayer-dev-eng] Should #include <X11/extensions/XShm.h> be conditional?

Ingo Brückl ib at wupperonline.de
Thu Jan 5 09:32:10 CET 2012


Ivan Kalvachev wrote on Thu, 5 Jan 2012 02:08:24 +0200:

> On 1/4/12, Ingo Brückl <ib at wupperonline.de> wrote:
>> While currently checking the #ifdefs in the GUI code and whether they are
>> necessary, I came across #include <X11/extensions/XShm.h>. As an extension,
>> it doesn't necessarily have to be present, does it?
>>
>> As far as I can see, there is no check or CONFIG definition for XShm in the
>> configure script.
>>
>> Should there be a condition for this include (and the function calls)?
>>
>> (Yeah, I know, this isn't exactly the direction I'm heading for...)

> There is "HAVE_SHM".

I'm not well versed in shared memory. Is HAVE_SHM (sys/shm.h) a prerequisite
for XShm? (Well, seems it is, because that's checked for in vo_x11, vo_xv and
vo_xvmc...)

So, if I've got it right, when building with HAVE_SHM then I can do a
XShmQueryExtension() and I'll end up either with or without shared memory at
runtime between client and server. When building without HAVE_SHM then I
cannot do a XShmQueryExtension() call and I'll end up without shared memory,
right?

Ingo


More information about the MPlayer-dev-eng mailing list