iOS: fix SDL_GetUIKitDeviceFormFactor return type

The function returns SDL_FormFactor values but was declared as bool,
so iOS devices were misclassified (e.g. tablets as desktop).
This commit is contained in:
Александр Андреев
2026-08-02 16:35:22 +02:00
committed by Sam Lantinga
parent 8dc177294b
commit fcd11827f4
2 changed files with 2 additions and 2 deletions

View File

@@ -874,7 +874,7 @@ SDL_FormFactor SDL_GetDeviceFormFactor(void)
#elif defined(SDL_PLATFORM_ANDROID)
return SDL_GetAndroidDeviceFormFactor();
#elif defined(SDL_PLATFORM_IOS)
extern bool SDL_GetUIKitDeviceFormFactor(void);
extern SDL_FormFactor SDL_GetUIKitDeviceFormFactor(void);
return SDL_GetUIKitDeviceFormFactor();
#elif defined(SDL_PLATFORM_XBOXONE) || defined(SDL_PLATFORM_XBOXSERIES) || defined(SDL_PLATFORM_PS2)
return SDL_FORMFACTOR_CONSOLE;

View File

@@ -385,7 +385,7 @@ void SDL_NSLog(const char *prefix, const char *text)
* subsystem, but we need to stuff this into an Objective-C source code file.
*/
bool SDL_GetUIKitDeviceFormFactor(void)
SDL_FormFactor SDL_GetUIKitDeviceFormFactor(void)
{
// TODO: Apple Watch
switch ([UIDevice currentDevice].userInterfaceIdiom) {