X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Farchitecture.cpp;h=3dd76fbf19f86e0e52fca14fee800fee04675dd6;hb=4ee988cdd18d919b11355c21e5234c3f28f5d6a7;hp=63ec6ba3f3dc5da4f60bd814a592547c0c1c1d15;hpb=76ede1d44e68182a2380260c22ec7be68c9817af;p=builder.git diff --git a/source/architecture.cpp b/source/architecture.cpp index 63ec6ba..3dd76fb 100644 --- a/source/architecture.cpp +++ b/source/architecture.cpp @@ -1,11 +1,9 @@ #include -#ifndef _WIN32 -#include -#endif #include #include #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::digits; native = true; } @@ -185,11 +174,11 @@ bool Architecture::match_name(const string &pattern) const return !negate; } -string Architecture::best_match(const list &names) const +string Architecture::best_match(const vector &names) const { string best; unsigned best_size = 0; - for(list::const_iterator i=names.begin(); i!=names.end(); ++i) + for(vector::const_iterator i=names.begin(); i!=names.end(); ++i) if(match_name(*i)) { /* TODO Do full parse and alias resolution here? Otherwise x86 and