]> git.tdb.fi Git - builder.git/blobdiff - source/architecture.cpp
Adapt to changes in mspcore
[builder.git] / source / architecture.cpp
index 63ec6ba3f3dc5da4f60bd814a592547c0c1c1d15..3dd76fbf19f86e0e52fca14fee800fee04675dd6 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;
        }
@@ -185,11 +174,11 @@ bool Architecture::match_name(const string &pattern) const
        return !negate;
 }
 
-string Architecture::best_match(const list<string> &names) const
+string Architecture::best_match(const vector<string> &names) const
 {
        string best;
        unsigned best_size = 0;
-       for(list<string>::const_iterator i=names.begin(); i!=names.end(); ++i)
+       for(vector<string>::const_iterator i=names.begin(); i!=names.end(); ++i)
                if(match_name(*i))
                {
                        /* TODO Do full parse and alias resolution here?  Otherwise x86 and