[PATCH 19/37] glx: Attempting to hide the GL stubs just makes the compiler angry

Adam Jackson ajax at redhat.com
Mon Nov 18 14:31:06 PST 2013


On Mon, 2013-11-18 at 13:38 -0800, Ian Romanick wrote:
> On 11/17/2013 12:01 AM, Keith Packard wrote:
> > Adding _X_HIDDEN doesn't actually maange to hide these functions as
> > the compiler refuses to change the visibility from what was declared
> > in gl.h
> > 
> > Signed-off-by: Keith Packard <keithp at keithp.com>
> > ---
> >  glx/glxstubs.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/glx/glxstubs.c b/glx/glxstubs.c
> > index 69bc004..99f1cba 100644
> > --- a/glx/glxstubs.c
> > +++ b/glx/glxstubs.c
> > @@ -34,7 +34,7 @@
> >  #include "glxserver.h"
> >  
> >  #define thunk(name, type, call_args, ...) \
> > -    _X_HIDDEN void name(__VA_ARGS__) { \
> > +    GLAPI void APIENTRY name(__VA_ARGS__) { \
> >  	static type proc; \
> >  	if (!proc) proc = __glGetProcAddress(#name); \
> >  	proc call_args; \
> > 
> 
> Yeah.... this can't work reliably and is generally yucky.  I'm curious
> why Adam didn't just use the GLEW trick of having a #define glFoo that
> calls through a function pointer _glewFoo.  I think Waffle does
> something similar... but is much more clever than GLEW by avoiding the
> need for a glewInit function.

Because I didn't think I'd need to.

- ajax



More information about the xorg-devel mailing list