]> git.tdb.fi Git - builder.git/blobdiff - source/architecture.cpp
Move system-specific code to a separate file
[builder.git] / source / architecture.cpp
index 63ec6ba3f3dc5da4f60bd814a592547c0c1c1d15..8bdd1bfe8fceef06070f91c6db73b20111e08b5d 100644 (file)
@@ -1,11 +1,9 @@
 #include <limits>
-#ifndef _WIN32
-#include <sys/utsname.h>
-#endif
 #include <msp/strings/format.h>
 #include <msp/strings/utils.h>
 #include "architecture.h"
 #include "builder.h"
+#include "sysutils.h"
 
 using namespace std;
 using namespace Msp;
@@ -95,18 +93,9 @@ Architecture::Architecture(Builder &b, const string &spec):
 {
        if(spec.empty())
        {
-#ifdef _WIN32
-               system = "windows";
-#else
-               utsname un;
-               if(uname(&un)==0)
-               {
-                       system = tolower(un.sysname);
-                       parse_specification(tolower(un.machine));
-                       // We really only want to set type for the default arch
-                       cpu.clear();
-               }
-#endif
+               parse_specification(get_system_type());
+               // We really only want to set type for the default arch
+               cpu.clear();
                bits = sizeof(void *)*numeric_limits<unsigned char>::digits;
                native = true;
        }