]> git.tdb.fi Git - builder.git/blob - source/sysutils.cpp
Move system-specific code to a separate file
[builder.git] / source / sysutils.cpp
1 #ifndef _WIN32
2 #include <sys/utsname.h>
3 #endif
4 #include <msp/strings/format.h>
5 #include <msp/strings/utils.h>
6 #include "sysutils.h"
7
8 using namespace std;
9 using namespace Msp;
10
11 string get_system_type()
12 {
13 #ifdef _WIN32
14         return "windows";
15 #else
16         utsname un;
17         if(uname(&un)==0)
18                 return tolower(format("%s-%s", un.sysname, un.machine));
19 #endif
20
21         return string();
22 }