Fix C89 declaration for macOS modules.

Since Clang 14, `-Wdeclaration-after-statement` is enforced on every
standard.
This commit is contained in:
Pierre Wendling
2022-06-27 15:43:17 -04:00
committed by Sam Lantinga
parent e4a8087551
commit 6c536afdb7
17 changed files with 375 additions and 270 deletions

View File

@@ -71,6 +71,10 @@ char *
SDL_GetPrefPath(const char *org, const char *app)
{ @autoreleasepool
{
char *retval = NULL;
static SDL_bool shown = SDL_FALSE;
NSArray *array;
if (!app) {
SDL_InvalidParamError("app");
return NULL;
@@ -79,9 +83,8 @@ SDL_GetPrefPath(const char *org, const char *app)
org = "";
}
char *retval = NULL;
#if !TARGET_OS_TV
NSArray *array = NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory, NSUserDomainMask, YES);
array = NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory, NSUserDomainMask, YES);
#else
/* tvOS does not have persistent local storage!
* The only place on-device where we can store data is
@@ -91,15 +94,13 @@ SDL_GetPrefPath(const char *org, const char *app)
* between sessions. If you want your app's save data to
* actually stick around, you'll need to use iCloud storage.
*/
static SDL_bool shown = SDL_FALSE;
if (!shown)
{
shown = SDL_TRUE;
SDL_LogCritical(SDL_LOG_CATEGORY_SYSTEM, "tvOS does not have persistent local storage! Use iCloud storage if you want your data to persist between sessions.\n");
}
NSArray *array = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES);
array = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES);
#endif /* !TARGET_OS_TV */
if ([array count] > 0) { /* we only want the first item in the list. */