File fix-gcc6.patch of Package xplatproviders
diff -Nur xplatproviders-1.0.0/source/code/common_lib/pal/system/cpu/cpuenumeration.cpp new/source/code/common_lib/pal/system/cpu/cpuenumeration.cpp
--- xplatproviders-1.0.0/source/code/common_lib/pal/system/cpu/cpuenumeration.cpp 2009-07-09 22:00:40.000000000 +0200
+++ new/source/code/common_lib/pal/system/cpu/cpuenumeration.cpp 2016-07-23 04:47:27.697555041 +0200
@@ -622,7 +622,7 @@
SCXHandle<wistream> statFile = m_deps->OpenStatFile();
wstring line;
- while (getline(*statFile, line) > 0)
+ while (getline(*statFile, line).good())
{
vector<wstring> tokens;
SCXCoreLib::SCXHandle<CPUInstance> inst(0);
diff -Nur xplatproviders-1.0.0/source/code/common_lib/util/stringaid.cpp new/source/code/common_lib/util/stringaid.cpp
--- xplatproviders-1.0.0/source/code/common_lib/util/stringaid.cpp 2009-07-09 22:00:41.000000000 +0200
+++ new/source/code/common_lib/util/stringaid.cpp 2016-07-23 04:48:31.457971710 +0200
@@ -347,7 +347,7 @@
unsigned int tmp;
wstringstream ss(str);
- bool conv_result = (ss >> tmp) != 0;
+ bool conv_result = !((ss >> tmp).fail());
// Note: I'm not sure which one MacOS belongs under; move it if needed
// once the unit tests are running.
@@ -394,7 +394,7 @@
double tmp;
wstringstream ss(str);
- bool conv_result = (ss >> tmp) != 0;
+ bool conv_result = !(ss >> tmp).fail();
if (!conv_result) {
throw SCXCoreLib::SCXNotSupportedException(L"Cannot parse double in: '" + str + L"'", SCXSRCLOCATION);
@@ -419,9 +419,9 @@
scxlong tmp;
wstringstream ss(str);
- bool conv_result = (ss >> tmp) != 0;
+ bool conv_result = (ss >> tmp).fail();
- if (!conv_result) {
+ if (conv_result) {
throw SCXCoreLib::SCXNotSupportedException(L"Cannot parse scxlong in: '" + str + L"'", SCXSRCLOCATION);
}
return tmp;
@@ -444,7 +444,7 @@
scxulong tmp;
wstringstream ss(str);
- bool conv_result = (ss >> tmp) != 0;
+ bool conv_result = !((ss >> tmp).fail());
// Note: I'm not sure which one MacOS belongs under; move it if needed
// once the unit tests are running.