mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-05-23 13:09:11 +00:00
Initialize interface structures so they can be extended in the future
We guarantee that we will only add to the end of these interfaces, and any new fields will be optional.
This commit is contained in:
parent
434193d153
commit
702ed83f72
13 changed files with 130 additions and 22 deletions
|
@ -142,6 +142,11 @@ SDL_JoystickID SDL_JoystickAttachVirtualInner(const SDL_VirtualJoystickDesc *des
|
|||
SDL_InvalidParamError("desc");
|
||||
return 0;
|
||||
}
|
||||
if (desc->version < sizeof(*desc)) {
|
||||
// Update this to handle older versions of this interface
|
||||
SDL_SetError("Invalid desc, should be initialized with SDL_INIT_INTERFACE()");
|
||||
return 0;
|
||||
}
|
||||
|
||||
hwdata = (joystick_hwdata *)SDL_calloc(1, sizeof(joystick_hwdata));
|
||||
if (!hwdata) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue