src/video/mir/SDL_mirdyn.c
changeset 10089 25fda20d0173
parent 10079 6eaf52c8d398
child 10737 3406a0f8b041
equal deleted inserted replaced
10088:33bee97dbcbb 10089:25fda20d0173
    82 #endif /* SDL_VIDEO_DRIVER_MIR_DYNAMIC */
    82 #endif /* SDL_VIDEO_DRIVER_MIR_DYNAMIC */
    83 
    83 
    84 /* Define all the function pointers and wrappers... */
    84 /* Define all the function pointers and wrappers... */
    85 #define SDL_MIR_MODULE(modname) int SDL_MIR_HAVE_##modname = 0;
    85 #define SDL_MIR_MODULE(modname) int SDL_MIR_HAVE_##modname = 0;
    86 #define SDL_MIR_SYM(rc,fn,params) SDL_DYNMIRFN_##fn MIR_##fn = NULL;
    86 #define SDL_MIR_SYM(rc,fn,params) SDL_DYNMIRFN_##fn MIR_##fn = NULL;
       
    87 #define SDL_MIR_SYM_CONST(type,name) SDL_DYMMIRCONST_##name MIR_##name = NULL;
    87 #include "SDL_mirsym.h"
    88 #include "SDL_mirsym.h"
    88 
    89 
    89 static int mir_load_refcount = 0;
    90 static int mir_load_refcount = 0;
    90 
    91 
    91 void
    92 void
    99 #endif
   100 #endif
   100             
   101             
   101             /* set all the function pointers to NULL. */
   102             /* set all the function pointers to NULL. */
   102 #define SDL_MIR_MODULE(modname) SDL_MIR_HAVE_##modname = 0;
   103 #define SDL_MIR_MODULE(modname) SDL_MIR_HAVE_##modname = 0;
   103 #define SDL_MIR_SYM(rc,fn,params) MIR_##fn = NULL;
   104 #define SDL_MIR_SYM(rc,fn,params) MIR_##fn = NULL;
       
   105 #define SDL_MIR_SYM_CONST(type,name) MIR_##name = NULL;
   104 #include "SDL_mirsym.h"
   106 #include "SDL_mirsym.h"
   105 
   107 
   106 
   108 
   107 #ifdef SDL_VIDEO_DRIVER_MIR_DYNAMIC
   109 #ifdef SDL_VIDEO_DRIVER_MIR_DYNAMIC
   108             for (i = 0; i < SDL_TABLESIZE(mirlibs); i++) {
   110             for (i = 0; i < SDL_TABLESIZE(mirlibs); i++) {
   136 #define SDL_MIR_MODULE(modname) SDL_MIR_HAVE_##modname = 1; /* default yes */
   138 #define SDL_MIR_MODULE(modname) SDL_MIR_HAVE_##modname = 1; /* default yes */
   137 #include "SDL_mirsym.h"
   139 #include "SDL_mirsym.h"
   138 
   140 
   139 #define SDL_MIR_MODULE(modname) thismod = &SDL_MIR_HAVE_##modname;
   141 #define SDL_MIR_MODULE(modname) thismod = &SDL_MIR_HAVE_##modname;
   140 #define SDL_MIR_SYM(rc,fn,params) MIR_##fn = (SDL_DYNMIRFN_##fn) MIR_GetSym(#fn,thismod);
   142 #define SDL_MIR_SYM(rc,fn,params) MIR_##fn = (SDL_DYNMIRFN_##fn) MIR_GetSym(#fn,thismod);
       
   143 #define SDL_MIR_SYM_CONST(type,name) MIR_##name = *(SDL_DYMMIRCONST_##name*) MIR_GetSym(#name,thismod);
   141 #include "SDL_mirsym.h"
   144 #include "SDL_mirsym.h"
   142 
   145 
   143         if ((SDL_MIR_HAVE_MIR_CLIENT) && (SDL_MIR_HAVE_XKBCOMMON)) {
   146         if ((SDL_MIR_HAVE_MIR_CLIENT) && (SDL_MIR_HAVE_XKBCOMMON)) {
   144             /* all required symbols loaded. */
   147             /* all required symbols loaded. */
   145             SDL_ClearError();
   148             SDL_ClearError();
   151 
   154 
   152 #else  /* no dynamic MIR */
   155 #else  /* no dynamic MIR */
   153 
   156 
   154 #define SDL_MIR_MODULE(modname) SDL_MIR_HAVE_##modname = 1; /* default yes */
   157 #define SDL_MIR_MODULE(modname) SDL_MIR_HAVE_##modname = 1; /* default yes */
   155 #define SDL_MIR_SYM(rc,fn,params) MIR_##fn = fn;
   158 #define SDL_MIR_SYM(rc,fn,params) MIR_##fn = fn;
       
   159 #define SDL_MIR_SYM_CONST(type,name) MIR_##name = name;
   156 #include "SDL_mirsym.h"
   160 #include "SDL_mirsym.h"
   157 
   161 
   158 #endif
   162 #endif
   159     }
   163     }
   160 
   164