Define SDL_PLATFORM_* macros instead of underscored ones (#8875)

This commit is contained in:
Anonymous Maarten
2024-01-24 02:40:51 +01:00
committed by GitHub
parent ceccf24519
commit 31d133db40
208 changed files with 1293 additions and 1138 deletions

View File

@@ -54,15 +54,15 @@ static FcitxClient fcitx_client;
static char *GetAppName(void)
{
#if defined(__LINUX__) || defined(__FREEBSD__)
#if defined(SDL_PLATFORM_LINUX) || defined(SDL_PLATFORM_FREEBSD)
char *spot;
char procfile[1024];
char linkfile[1024];
int linksize;
#ifdef __LINUX__
#ifdef SDL_PLATFORM_LINUX
(void)SDL_snprintf(procfile, sizeof(procfile), "/proc/%d/exe", getpid());
#elif defined(__FREEBSD__)
#elif defined(SDL_PLATFORM_FREEBSD)
(void)SDL_snprintf(procfile, sizeof(procfile), "/proc/%d/file", getpid());
#endif
linksize = readlink(procfile, linkfile, sizeof(linkfile) - 1);
@@ -75,7 +75,7 @@ static char *GetAppName(void)
return SDL_strdup(linkfile);
}
}
#endif /* __LINUX__ || __FREEBSD__ */
#endif /* SDL_PLATFORM_LINUX || SDL_PLATFORM_FREEBSD */
return SDL_strdup("SDL_App");
}