From: Alexandre Julliard Subject: Re: [PATCH v3 2/7] winebus.sys: Support adding and removing SDL devices Message-Id: <87inar1m0b.fsf@winehq.org> Date: Tue, 20 Feb 2018 20:47:32 +0100 In-Reply-To: <495e8bfd-7bf8-7b41-00ff-26fed5d3e6ad@codeweavers.com> (Aric Stewart's message of "Tue, 20 Feb 2018 13:30:46 -0600") References: <495e8bfd-7bf8-7b41-00ff-26fed5d3e6ad@codeweavers.com> Aric Stewart 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). -- Alexandre Julliard julliard@winehq.org