#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;
{
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;
}
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