src/video/x11/SDL_x11dyn.h
changeset 7827 a03ec8de0426
parent 6885 700f1b25f77f
child 8093 b43765095a6f
     1.1 --- a/src/video/x11/SDL_x11dyn.h	Thu Oct 17 20:49:30 2013 -0700
     1.2 +++ b/src/video/x11/SDL_x11dyn.h	Fri Oct 18 01:36:41 2013 -0400
     1.3 @@ -69,35 +69,34 @@
     1.4  #include <X11/extensions/xf86vmode.h>
     1.5  #endif
     1.6  
     1.7 -/*
     1.8 - * When using the "dynamic X11" functionality, we duplicate all the Xlib
     1.9 - *  symbols that would be referenced by SDL inside of SDL itself.
    1.10 - *  These duplicated symbols just serve as passthroughs to the functions
    1.11 - *  in Xlib, that was dynamically loaded.
    1.12 - *
    1.13 - * This allows us to use Xlib as-is when linking against it directly, but
    1.14 - *  also handles all the strange cases where there was code in the Xlib
    1.15 - *  headers that may or may not exist or vary on a given platform.
    1.16 - */
    1.17  #ifdef __cplusplus
    1.18  extern "C"
    1.19  {
    1.20  #endif
    1.21  
    1.22  /* evil function signatures... */
    1.23 -    typedef Bool(*SDL_X11_XESetWireToEventRetType) (Display *, XEvent *,
    1.24 -                                                    xEvent *);
    1.25 -    typedef int (*SDL_X11_XSynchronizeRetType) (Display *);
    1.26 -    typedef Status(*SDL_X11_XESetEventToWireRetType) (Display *, XEvent *,
    1.27 -                                                      xEvent *);
    1.28 +typedef Bool(*SDL_X11_XESetWireToEventRetType) (Display *, XEvent *, xEvent *);
    1.29 +typedef int (*SDL_X11_XSynchronizeRetType) (Display *);
    1.30 +typedef Status(*SDL_X11_XESetEventToWireRetType) (Display *, XEvent *, xEvent *);
    1.31  
    1.32 -    int SDL_X11_LoadSymbols(void);
    1.33 -    void SDL_X11_UnloadSymbols(void);
    1.34 +int SDL_X11_LoadSymbols(void);
    1.35 +void SDL_X11_UnloadSymbols(void);
    1.36  
    1.37 -/* That's really annoying...make these function pointers no matter what. */
    1.38 +/* Declare all the function pointers and wrappers... */
    1.39 +#define SDL_X11_MODULE(modname)
    1.40 +#define SDL_X11_SYM(rc,fn,params,args,ret) \
    1.41 +    typedef rc (*SDL_DYNX11FN_##fn) params; \
    1.42 +    extern SDL_DYNX11FN_##fn X11_##fn;
    1.43 +#include "SDL_x11sym.h"
    1.44 +#undef SDL_X11_MODULE
    1.45 +#undef SDL_X11_SYM
    1.46 +
    1.47 +/* Annoying varargs entry point... */
    1.48  #ifdef X_HAVE_UTF8_STRING
    1.49 -    extern XIC(*pXCreateIC) (XIM, ...);
    1.50 -    extern char *(*pXGetICValues) (XIC, ...);
    1.51 +typedef XIC(*SDL_DYNX11FN_XCreateIC) (XIM,...);
    1.52 +typedef char *(*SDL_DYNX11FN_XGetICValues) (XIC, ...);
    1.53 +extern SDL_DYNX11FN_XCreateIC X11_XCreateIC;
    1.54 +extern SDL_DYNX11FN_XGetICValues X11_XGetICValues;
    1.55  #endif
    1.56  
    1.57  /* These SDL_X11_HAVE_* flags are here whether you have dynamic X11 or not. */
    1.58 @@ -107,7 +106,6 @@
    1.59  #undef SDL_X11_MODULE
    1.60  #undef SDL_X11_SYM
    1.61  
    1.62 -
    1.63  #ifdef __cplusplus
    1.64  }
    1.65  #endif