From 0dda8733dbe481b6619604682bc888400277c379 Mon Sep 17 00:00:00 2001 From: Cacodemon345 Date: Thu, 31 Dec 2020 18:48:48 +0600 Subject: [PATCH] Print name of OS on POSIX systems when using SDL #1265 --- src/common/platform/posix/sdl/i_main.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/common/platform/posix/sdl/i_main.cpp b/src/common/platform/posix/sdl/i_main.cpp index a984721fc..810596834 100644 --- a/src/common/platform/posix/sdl/i_main.cpp +++ b/src/common/platform/posix/sdl/i_main.cpp @@ -40,6 +40,7 @@ #include #include #include +#include #include "engineerrors.h" #include "m_argv.h" @@ -49,6 +50,7 @@ #include "engineerrors.h" #include "i_system.h" #include "i_interface.h" +#include "printf.h" // MACROS ------------------------------------------------------------------ @@ -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();