Skip to content

Commit 4441d8b

Browse files
smcvslouken
authored andcommitted
x11: Don't include XDestroyImage in the table of exported functions
When linking directly to libX11 as a hard dependency, we assign the addresses of functions like XDestroyImage to function pointers like X11_XDestroyImage. However, by default Xutils.h doesn't declare XDestroyImage as a function: it only provides a macro which looks into the XImage struct and calls a function pointer directly, similar to a virtual method. SDL_x11framebuffer.c was already relying on being able to call the macro without explicitly linking to libX11, so do the same here. Fixes: d14cbd7 "Introduce X11 toolkit and make message dialogs use it" Signed-off-by: Simon McVittie <[email protected]>
1 parent 5105224 commit 4441d8b

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

src/video/x11/SDL_x11sym.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@ SDL_X11_SYM(Status,XInitThreads,(void))
105105
SDL_X11_SYM(int,XPeekEvent,(Display* a,XEvent* b))
106106
SDL_X11_SYM(int,XPending,(Display* a))
107107
SDL_X11_SYM(XImage*,XGetImage,(Display* a,Drawable b,int c, int d,unsigned int e,unsigned int f,unsigned long g,int h))
108-
SDL_X11_SYM(void,XDestroyImage,(XImage *a))
109108
SDL_X11_SYM(int,XPutImage,(Display* a,Drawable b,GC c,XImage* d,int e,int f,int g,int h,unsigned int i,unsigned int j))
110109
SDL_X11_SYM(int,XQueryKeymap,(Display* a,char b[32]))
111110
SDL_X11_SYM(Bool,XQueryPointer,(Display* a,Window b,Window* c,Window* d,int* e,int* f,int* g,int* h,unsigned int* i))

src/video/x11/SDL_x11toolkit.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -981,10 +981,10 @@ static void X11Toolkit_DrawWindow(SDL_ToolkitWindowX11 *data) {
981981
put_image = X11_XCreateImage(data->display, data->visual, data->vi.depth, ZPixmap, 0, put_surface->pixels, data->window_width, data->window_height, 32, put_surface->pitch);
982982
X11_XPutImage(data->display, data->window, data->ctx, put_image, 0, 0, 0, 0, data->window_width, data->window_height);
983983

984-
X11_XDestroyImage(pixmap_image);
984+
XDestroyImage(pixmap_image);
985985
/* Needed because XDestroyImage results in a double-free otherwise */
986986
put_image->data = NULL;
987-
X11_XDestroyImage(put_image);
987+
XDestroyImage(put_image);
988988
SDL_DestroySurface(pixmap_surface);
989989
SDL_DestroySurface(put_surface);
990990
}

0 commit comments

Comments
 (0)