[XForms] Patch: Context Sharing + fdesign (real thing)

Angus Leeming angus.leeming at btopenworld.com
Mon May 17 06:27:29 EDT 2004


On Monday 17 May 2004 11:14 am, Jean-Marc Lasgouttes wrote:
> Angus> #ifdef GLCANVAS_H_LOCATION #include GLCANVAS_H_LOCATION
> #endif
>
> There are two separate issues:
>
> 1/ the easiest one: we need the xxx_LOCATION nonsense because
> imake-based build systems tend to put header files in places like
> X11/forms.h. This is not the case anymore, so we should assume now
> that header files have to be on the search path. Thus a #include
> "glcanvas.h" should be enough.

Yes.

> 2/ the problem of including glcanvas.h: If we are serious about
> separating the gl stuff from the rest, we want people to be able to
> use forms.h without any gl stuff installed. I would prefer to make
> people include "glcanvas.h" manually, but I agree that we can have
> a backdoor for people who do not want to change their code. In this
> case, we should probably rely on a HAVE_GLCANVAS_H define, which is
> straightforward to define through autoconf, and add code like
> #ifdef HAVE_GLCANVAS_H
> #include "glcanvas.h"
> #endif

Yes.

> However, I think that we should not make this way the preferred
> way, because it is a bit unnatural to my eyes.

Agreed. This solution provides a means for people to continue to 
compile existing code. It's not nice and shouldn't be on by default.

> Do you think it would work correctly?

Yes. However, I don't think we should add HAVE_GLCANVAS_H to *our* 
autoconf files. This 'nonsense' is for whatever configure-magic the 
*user* uses to compile his code. All *we* need to do is to provide 
the pre-processor handle. Why not be explicit and define
	INCLUDE_GLCANVAS_H_FROM_CANVAS_H
? I think that being verbose here is a good thing.

> Angus> This is all separate to the 'glcanvas.h should be
> Angus> self-contained' problem.
>
> Concerning this later problem, I am not sure we want to enforce it.
> Asking people to include forms.h seems rather reasonable to me.

<whine>
But it's inelegant!
</whine>

Anyway, the #include <GL/glx.h> and the C++ guards are definitely 
needed IMO. Agree?

Angus



More information about the Xforms mailing list