Platforms files: Added unix32-unsigned and unix64-unsigned. Not sure what extension to use for platform files, chose .xml now.

This commit is contained in:
Daniel Marjamäki 2016-01-08 11:16:38 +01:00
parent 8082e8130e
commit 794e64bb29
3 changed files with 47 additions and 7 deletions

View File

@ -284,7 +284,7 @@ bool Settings::platformFile(const std::string &filename)
return false;
for (const tinyxml2::XMLElement *node = rootnode->FirstChildElement(); node; node = node->NextSiblingElement()) {
if (std::strcmp(node->Name(), "defaultSign") == 0)
if (std::strcmp(node->Name(), "default-sign") == 0)
defaultSign = *node->GetText();
else if (std::strcmp(node->Name(), "char_bit") == 0)
char_bit = std::atoi(node->GetText());
@ -292,18 +292,24 @@ bool Settings::platformFile(const std::string &filename)
for (const tinyxml2::XMLElement *sz = node->FirstChildElement(); sz; sz = sz->NextSiblingElement()) {
if (std::strcmp(node->Name(), "short") == 0)
sizeof_short = std::atoi(node->GetText());
if (std::strcmp(node->Name(), "int") == 0)
else if (std::strcmp(node->Name(), "int") == 0)
sizeof_int = std::atoi(node->GetText());
if (std::strcmp(node->Name(), "long") == 0)
else if (std::strcmp(node->Name(), "long") == 0)
sizeof_long = std::atoi(node->GetText());
if (std::strcmp(node->Name(), "long-long") == 0)
else if (std::strcmp(node->Name(), "long-long") == 0)
sizeof_long_long = std::atoi(node->GetText());
if (std::strcmp(node->Name(), "float") == 0)
else if (std::strcmp(node->Name(), "float") == 0)
sizeof_float = std::atoi(node->GetText());
if (std::strcmp(node->Name(), "double") == 0)
else if (std::strcmp(node->Name(), "double") == 0)
sizeof_double = std::atoi(node->GetText());
if (std::strcmp(node->Name(), "pointer") == 0)
else if (std::strcmp(node->Name(), "long-double") == 0)
sizeof_long_double = std::atoi(node->GetText());
else if (std::strcmp(node->Name(), "pointer") == 0)
sizeof_pointer = std::atoi(node->GetText());
else if (std::strcmp(node->Name(), "size_t") == 0)
sizeof_size_t = std::atoi(node->GetText());
else if (std::strcmp(node->Name(), "wchar_t") == 0)
sizeof_wchar_t = std::atoi(node->GetText());
}
}
}

View File

@ -0,0 +1,17 @@
<?xml version="1.0"?>
<platform>
<char_bit>8</char_bit>
<default-sign>u</default-sign>
<sizeof>
<short>2</short>
<int>4</int>
<long>4</long>
<long-long>8</long-long>
<float>4</float>
<double>8</double>
<long-double>12</long-double>
<pointer>4</pointer>
<size_t>4</size_t>
<wchar_t>2</wchar_t>
</sizeof>
</platform>

View File

@ -0,0 +1,17 @@
<?xml version="1.0"?>
<platform>
<char_bit>8</char_bit>
<default-sign>u</default-sign>
<sizeof>
<short>2</short>
<int>4</int>
<long>8</long>
<long-long>8</long-long>
<float>4</float>
<double>8</double>
<long-double>16</long-double>
<pointer>8</pointer>
<size_t>8</size_t>
<wchar_t>4</wchar_t>
</sizeof>
</platform>