[PATCH 1/1] glxstubs: Don't mix availability types on non-ELF

Jon TURNEY jon.turney at dronecode.org.uk
Mon Dec 2 04:37:14 PST 2013


On 29/11/2013 19:36, Jeremy Huddleston Sequoia wrote:
> Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu-2kanFRK1NckAvxtiuMwx3w at public.gmane.org>
> ---
>  glx/glxstubs.c | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/glx/glxstubs.c b/glx/glxstubs.c
> index 69bc004..509f65c 100644
> --- a/glx/glxstubs.c
> +++ b/glx/glxstubs.c
> @@ -33,8 +33,14 @@
>  #include <inttypes.h>
>  #include "glxserver.h"
>  
> +#ifdef __ELF__
> +#define _THUNK_AVAILABILITY _X_HIDDEN
> +#else
> +#define _THUNK_AVAILABILITY
> +#endif

I'm not sure what bug this is fixing, but wouldn't it be better to write this
test in a a positive form (i.e. #ifdef __MACH__) ?

> +
>  #define thunk(name, type, call_args, ...) \
> -    _X_HIDDEN void name(__VA_ARGS__) { \
> +    _THUNK_AVAILABILITY void name(__VA_ARGS__) { \
>  	static type proc; \
>  	if (!proc) proc = __glGetProcAddress(#name); \
>  	proc call_args; \
> 

But I think there's something suspicious about this code.  I can't see
anywhere that __glXsetGetProcAddress() gets called, so __glGetProcAddress() is
always going to return NULL?



More information about the xorg-devel mailing list