wok annotate libsdl/stuff/sdl-1.2.14-add-XGetRequest-symbol.patch @ rev 20367

debugging code removed
author Erkan Yilmaz <erkan@slitaz.org>
date Sat Jun 09 20:50:42 2018 +0000 (2018-06-09)
parents
children
rev   line source
pascal@14719 1 _XGetRequest API was backported to libx11-1.4.4 in:
pascal@14719 2 http://git.openembedded.org/openembedded-core/commit/?id=e08604800fe1cb8f240f53c147ceb4ee08a29b91
pascal@14719 3
pascal@14719 4 This breaks e.g. libsdl-image build with:
pascal@14719 5 | /OE/shr-core/tmp-eglibc/sysroots/qemux86-64/usr/lib/libSDL.so: undefined reference to `_XGetRequest'
pascal@14719 6
pascal@14719 7 For details see: https://bugzilla.redhat.com/show_bug.cgi?id=782251
pascal@14719 8
pascal@14719 9 Upstrea-Status: Accepted
pascal@14719 10
pascal@14719 11 @@ -, +, @@
pascal@14719 12 added.
pascal@14719 13 src/video/x11/SDL_x11dyn.c | 24 ++++++++++++++++++++++++
pascal@14719 14 src/video/x11/SDL_x11sym.h | 6 ++++++
pascal@14719 15 2 files changed, 30 insertions(+), 0 deletions(-)
pascal@14719 16 --- a/src/video/x11/SDL_x11dyn.c
pascal@14719 17 +++ a/src/video/x11/SDL_x11dyn.c
pascal@14719 18 @@ -109,6 +109,21 @@ char *(*pXGetICValues)(XIC, ...) = NULL;
pascal@14719 19 #undef SDL_X11_SYM
pascal@14719 20
pascal@14719 21
pascal@14719 22 +static void *SDL_XGetRequest_workaround(Display* dpy, CARD8 type, size_t len)
pascal@14719 23 +{
pascal@14719 24 + xReq *req;
pascal@14719 25 + WORD64ALIGN
pascal@14719 26 + if (dpy->bufptr + len > dpy->bufmax)
pascal@14719 27 + _XFlush(dpy);
pascal@14719 28 + dpy->last_req = dpy->bufptr;
pascal@14719 29 + req = (xReq*)dpy->bufptr;
pascal@14719 30 + req->reqType = type;
pascal@14719 31 + req->length = len / 4;
pascal@14719 32 + dpy->bufptr += len;
pascal@14719 33 + dpy->request++;
pascal@14719 34 + return req;
pascal@14719 35 +}
pascal@14719 36 +
pascal@14719 37 static int x11_load_refcount = 0;
pascal@14719 38
pascal@14719 39 void SDL_X11_UnloadSymbols(void)
pascal@14719 40 @@ -168,6 +183,15 @@ int SDL_X11_LoadSymbols(void)
pascal@14719 41 X11_GetSym("XGetICValues",&SDL_X11_HAVE_UTF8,(void **)&pXGetICValues);
pascal@14719 42 #endif
pascal@14719 43
pascal@14719 44 + /*
pascal@14719 45 + * In case we're built with newer Xlib headers, we need to make sure
pascal@14719 46 + * that _XGetRequest() is available, even on older systems.
pascal@14719 47 + * Otherwise, various Xlib macros we use will call a NULL pointer.
pascal@14719 48 + */
pascal@14719 49 + if (!SDL_X11_HAVE_XGETREQUEST) {
pascal@14719 50 + p_XGetRequest = SDL_XGetRequest_workaround;
pascal@14719 51 + }
pascal@14719 52 +
pascal@14719 53 if (SDL_X11_HAVE_BASEXLIB) { /* all required symbols loaded. */
pascal@14719 54 SDL_ClearError();
pascal@14719 55 } else {
pascal@14719 56 --- a/src/video/x11/SDL_x11sym.h
pascal@14719 57 +++ a/src/video/x11/SDL_x11sym.h
pascal@14719 58 @@ -170,6 +170,12 @@ SDL_X11_SYM(void,_XRead32,(Display *dpy,register long *data,long len),(dpy,data,
pascal@14719 59 #endif
pascal@14719 60
pascal@14719 61 /*
pascal@14719 62 + * libX11 1.4.99.1 added _XGetRequest, and macros use it behind the scenes.
pascal@14719 63 + */
pascal@14719 64 +SDL_X11_MODULE(XGETREQUEST)
pascal@14719 65 +SDL_X11_SYM(void *,_XGetRequest,(Display* a,CARD8 b,size_t c),(a,b,c),return)
pascal@14719 66 +
pascal@14719 67 +/*
pascal@14719 68 * These only show up on some variants of Unix.
pascal@14719 69 */
pascal@14719 70 #if defined(__osf__)