Merge branch 'get-sys-name' into 'next'

Add common I_GetSysName function

See merge request STJr/SRB2!2308
This commit is contained in:
sphere 2024-02-13 15:42:30 +00:00
commit ff851dcb44
4 changed files with 16 additions and 12 deletions

View file

@ -206,5 +206,10 @@ void I_GetCursorPosition(INT32 *x, INT32 *y)
(void)y;
}
const char *I_GetSysName(void)
{
return NULL;
}
#include "../sdl/dosstr.c"

View file

@ -335,4 +335,8 @@ void I_GetCursorPosition(INT32 *x, INT32 *y);
*/
void I_SetMouseGrab(boolean grab);
/** \brief Returns the system name.
*/
const char *I_GetSysName(void);
#endif

View file

@ -3812,18 +3812,7 @@ static void Command_Version_f(void)
#endif
// OS
// Would be nice to use SDL_GetPlatform for this
#if defined (_WIN32) || defined (_WIN64)
CONS_Printf("Windows ");
#elif defined(__linux__)
CONS_Printf("Linux ");
#elif defined(MACOSX)
CONS_Printf("macOS ");
#elif defined(UNIXCOMMON)
CONS_Printf("Unix (Common) ");
#else
CONS_Printf("Other OS ");
#endif
CONS_Printf("%s ", I_GetSysName());
// Bitness
if (sizeof(void*) == 4)

View file

@ -3256,4 +3256,10 @@ const CPUInfoFlags *I_CPUInfo(void)
// note CPUAFFINITY code used to reside here
void I_RegisterSysCommands(void) {}
const char *I_GetSysName(void)
{
return SDL_GetPlatform();
}
#endif