mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-27 21:48:29 +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:
@@ -153,6 +153,11 @@ SDL_Storage *SDL_OpenStorage(const SDL_StorageInterface *iface, void *userdata)
|
||||
SDL_InvalidParamError("iface");
|
||||
return NULL;
|
||||
}
|
||||
if (iface->version < sizeof(*iface)) {
|
||||
// Update this to handle older versions of this interface
|
||||
SDL_SetError("Invalid interface, should be initialized with SDL_INIT_INTERFACE()");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
storage = (SDL_Storage *)SDL_calloc(1, sizeof(*storage));
|
||||
if (storage) {
|
||||
|
Reference in New Issue
Block a user