Aric Stewart aric@codeweavers.com writes:
+#ifdef SONAME_LIBSDL2 +#define MAKE_FUNCPTR(f) static typeof(f) * p##f = NULL +MAKE_FUNCPTR(SDL_GetError); +MAKE_FUNCPTR(SDL_Init); +MAKE_FUNCPTR(SDL_JoystickEventState); +MAKE_FUNCPTR(SDL_JoystickGetGUID); +MAKE_FUNCPTR(SDL_JoystickGetGUIDString); +#ifdef HAVE_SDL_VIDPID +MAKE_FUNCPTR(SDL_JoystickGetProduct); +MAKE_FUNCPTR(SDL_JoystickGetProductVersion); +MAKE_FUNCPTR(SDL_JoystickGetVendor); +#endif
Now that you are loading the library dynamically, HAVE_SDL_VIDPID should be replaced by a run-time check for the necessary functions (note that you may need to declare the prototypes explicitly if they are missing from the header).