Skip to content

Commit

Permalink
Print name of OS on POSIX systems when using SDL
Browse files Browse the repository at this point in the history
  • Loading branch information
Cacodemon345 committed Dec 31, 2020
1 parent d813425 commit 0dda873
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/common/platform/posix/sdl/i_main.cpp
Expand Up @@ -40,6 +40,7 @@
#include <new>
#include <sys/param.h>
#include <locale.h>
#include <sys/utsname.h>

#include "engineerrors.h"
#include "m_argv.h"
Expand All @@ -49,6 +50,7 @@
#include "engineerrors.h"
#include "i_system.h"
#include "i_interface.h"
#include "printf.h"

// MACROS ------------------------------------------------------------------

Expand Down Expand Up @@ -93,7 +95,12 @@ static int GetCrashInfo (char *buffer, char *end)

void I_DetectOS()
{
// The POSIX version never implemented this.
utsname unameInfo;
int unameRes = uname(&unameInfo);
if (unameRes != -1)
{
Printf("OS: %s %s on %s\n", unameInfo.sysname, unameInfo.release, unameInfo.machine);
}
}

void I_StartupJoysticks();
Expand Down

0 comments on commit 0dda873

Please sign in to comment.