From c1064830dab447f98f712cb09f408acb6f077d3d Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Fri, 12 Jul 2013 12:28:02 +0200 Subject: fix sdl compile --- .../sdl/patches/patch-src_video_x11_SDL_x11dyn_c | 39 ++++++++++++++++++++++ .../sdl/patches/patch-src_video_x11_SDL_x11sym_h | 15 +++++++++ 2 files changed, 54 insertions(+) create mode 100644 package/sdl/patches/patch-src_video_x11_SDL_x11dyn_c create mode 100644 package/sdl/patches/patch-src_video_x11_SDL_x11sym_h (limited to 'package/sdl/patches') diff --git a/package/sdl/patches/patch-src_video_x11_SDL_x11dyn_c b/package/sdl/patches/patch-src_video_x11_SDL_x11dyn_c new file mode 100644 index 000000000..ed389a110 --- /dev/null +++ b/package/sdl/patches/patch-src_video_x11_SDL_x11dyn_c @@ -0,0 +1,39 @@ +--- SDL-1.2.14.orig/src/video/x11/SDL_x11dyn.c 2009-10-13 01:07:15.000000000 +0200 ++++ SDL-1.2.14/src/video/x11/SDL_x11dyn.c 2013-07-12 12:15:17.000000000 +0200 +@@ -108,6 +108,20 @@ char *(*pXGetICValues)(XIC, ...) = NULL; + #undef SDL_X11_MODULE + #undef SDL_X11_SYM + ++static void *SDL_XGetRequest_workaround(Display* dpy, CARD8 type, size_t len) ++{ ++ xReq *req; ++ WORD64ALIGN ++ if (dpy->bufptr + len > dpy->bufmax) ++ _XFlush(dpy); ++ dpy->last_req = dpy->bufptr; ++ req = (xReq*)dpy->bufptr; ++ req->reqType = type; ++ req->length = len / 4; ++ dpy->bufptr += len; ++ dpy->request++; ++ return req; ++} + + static int x11_load_refcount = 0; + +@@ -168,6 +182,15 @@ int SDL_X11_LoadSymbols(void) + X11_GetSym("XGetICValues",&SDL_X11_HAVE_UTF8,(void **)&pXGetICValues); + #endif + ++ /* ++ * In case we're built with newer Xlib headers, we need to make sure ++ * that _XGetRequest() is available, even on older systems. ++ * Otherwise, various Xlib macros we use will call a NULL pointer. ++ */ ++ if (!SDL_X11_HAVE_XGETREQUEST) { ++ p_XGetRequest = SDL_XGetRequest_workaround; ++ } ++ + if (SDL_X11_HAVE_BASEXLIB) { /* all required symbols loaded. */ + SDL_ClearError(); + } else { diff --git a/package/sdl/patches/patch-src_video_x11_SDL_x11sym_h b/package/sdl/patches/patch-src_video_x11_SDL_x11sym_h new file mode 100644 index 000000000..45f3de058 --- /dev/null +++ b/package/sdl/patches/patch-src_video_x11_SDL_x11sym_h @@ -0,0 +1,15 @@ +--- SDL-1.2.14.orig/src/video/x11/SDL_x11sym.h 2009-10-13 01:07:15.000000000 +0200 ++++ SDL-1.2.14/src/video/x11/SDL_x11sym.h 2013-07-12 12:16:08.000000000 +0200 +@@ -170,6 +170,12 @@ SDL_X11_SYM(void,_XRead32,(Display *dpy, + #endif + + /* ++ * libX11 1.4.99.1 added _XGetRequest, and macros use it behind the scenes. ++ */ ++SDL_X11_MODULE(XGETREQUEST) ++SDL_X11_SYM(void *,_XGetRequest,(Display* a,CARD8 b,size_t c),(a,b,c),return) ++ ++/* + * These only show up on some variants of Unix. + */ + #if defined(__osf__) -- cgit v1.2.3