Ports: Remove obsolete patches for cmake

This commit is contained in:
Gunnar Beutner 2021-05-08 21:52:20 +02:00 committed by Andreas Kling
parent 12c98105bc
commit 27005fe846
12 changed files with 0 additions and 1338 deletions

View file

@ -1,62 +0,0 @@
From f9a88260a01aff91971ca88030b74e916a5daa39 Mon Sep 17 00:00:00 2001
From: AnotherTest <ali.mpfard@gmail.com>
Date: Thu, 11 Feb 2021 19:25:37 +0330
Subject: [PATCH 02/11] stoi -> atoi
---
Source/cmForEachCommand.cxx | 2 +-
Source/cmStandardLevelResolver.cxx | 4 ++--
Source/cmVSSetupHelper.cxx | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/Source/cmForEachCommand.cxx b/Source/cmForEachCommand.cxx
index bcacb15..c74cbdb 100644
--- a/Source/cmForEachCommand.cxx
+++ b/Source/cmForEachCommand.cxx
@@ -359,7 +359,7 @@ bool HandleInMode(std::vector<std::string> const& args,
bool TryParseInteger(cmExecutionStatus& status, const std::string& str, int& i)
{
try {
- i = std::stoi(str);
+ i = atoi((str).c_str());
} catch (std::invalid_argument&) {
std::ostringstream e;
e << "Invalid integer: '" << str << "'";
diff --git a/Source/cmStandardLevelResolver.cxx b/Source/cmStandardLevelResolver.cxx
index 8672f61..c418b09 100644
--- a/Source/cmStandardLevelResolver.cxx
+++ b/Source/cmStandardLevelResolver.cxx
@@ -116,7 +116,7 @@ struct StanardLevelComputer
int standardValue = -1;
int defaultValue = -1;
try {
- standardValue = std::stoi(standardStr);
+ standardValue = atoi((standardStr).c_str());
defaultValue = std::stoi(*defaultStd);
} catch (std::invalid_argument&) {
// fall through as we want an error
@@ -532,7 +532,7 @@ bool cmStandardLevelResolver::IsLaterStandard(std::string const& lang,
{
auto mapping = StandardComputerMapping.find(lang);
if (mapping != cm::cend(StandardComputerMapping)) {
- return mapping->second.IsLaterStandard(std::stoi(lhs), std::stoi(rhs));
+ return mapping->second.IsLaterStandard(atoi((lhs).c_str()), atoi((rhs).c_str()));
}
return false;
}
diff --git a/Source/cmVSSetupHelper.cxx b/Source/cmVSSetupHelper.cxx
index 6aa0d15..a4dac5e 100644
--- a/Source/cmVSSetupHelper.cxx
+++ b/Source/cmVSSetupHelper.cxx
@@ -318,7 +318,7 @@ bool cmVSSetupAPIHelper::EnumerateAndChooseVSInstance()
chosenInstanceInfo.Version =
std::string(envVSVersion.begin(), envVSVersion.end());
chosenInstanceInfo.VCToolsetVersion = envVSVersion;
- chosenInstanceInfo.ullVersion = std::stoi(envVSVersion);
+ chosenInstanceInfo.ullVersion = atoi((envVSVersion).c_str());
chosenInstanceInfo.IsWin10SDKInstalled = true;
chosenInstanceInfo.IsWin81SDKInstalled = !envWindowsSdkDir81.empty();
return true;
--
2.30.1

View file

@ -1,122 +0,0 @@
From ba18f1f52135b3dc08e4c7889f214807ce6bb966 Mon Sep 17 00:00:00 2001
From: AnotherTest <ali.mpfard@gmail.com>
Date: Thu, 11 Feb 2021 19:35:50 +0330
Subject: [PATCH 03/11] stoi -> atoi 2
---
Source/cmFileCommand.cxx | 2 +-
Source/cmListCommand.cxx | 22 +++++++++++-----------
Source/cmStandardLevelResolver.cxx | 8 ++++----
3 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx
index 372179c..ea9631a 100644
--- a/Source/cmFileCommand.cxx
+++ b/Source/cmFileCommand.cxx
@@ -3104,7 +3104,7 @@ bool HandleArchiveCreateCommand(std::vector<std::string> const& args,
cmSystemTools::SetFatalErrorOccured();
return false;
}
- compressionLevel = std::stoi(parsedArgs.CompressionLevel);
+ compressionLevel = atoi((parsedArgs.CompressionLevel).c_str());
if (compressionLevel < 0 || compressionLevel > 9) {
status.SetError(cmStrCat("compression level ",
parsedArgs.CompressionLevel,
diff --git a/Source/cmListCommand.cxx b/Source/cmListCommand.cxx
index 687273e..a79074d 100644
--- a/Source/cmListCommand.cxx
+++ b/Source/cmListCommand.cxx
@@ -901,12 +901,12 @@ bool HandleTransformCommand(std::vector<std::string> const& args,
// get all specified indexes
std::vector<int> indexes;
while (args.size() > ++index) {
- std::size_t pos;
+ char* pos;
int value;
try {
- value = std::stoi(args[index], &pos);
- if (pos != args[index].length()) {
+ value = strtol(args[index].c_str(), &pos, 10);
+ if (pos != args[index].c_str() + args[index]) {
// this is not a number, stop processing
break;
}
@@ -944,15 +944,15 @@ bool HandleTransformCommand(std::vector<std::string> const& args,
int step = 1;
bool valid = true;
try {
- std::size_t pos;
+ char* pos;
- start = std::stoi(args[index], &pos);
- if (pos != args[index].length()) {
+ start = strtol(args[index].c_str(), &pos, 10);
+ if (pos != args[index].c_str() + args[index].length()) {
// this is not a number
valid = false;
} else {
- stop = std::stoi(args[++index], &pos);
- if (pos != args[index].length()) {
+ start = strtol(args[++index].c_str(), &pos, 10);
+ if (pos != args[index].c_str() + args[index].length()) {
// this is not a number
valid = false;
}
@@ -969,10 +969,10 @@ bool HandleTransformCommand(std::vector<std::string> const& args,
// try to read a third numeric value for step
if (args.size() > ++index) {
try {
- std::size_t pos;
+ char* pos;
- step = std::stoi(args[index], &pos);
- if (pos != args[index].length()) {
+ start = strtol(args[index].c_str(), &pos, 10);
+ if (pos != args[index].c_str() + args[index].length()) {
// this is not a number
step = 1;
} else {
diff --git a/Source/cmStandardLevelResolver.cxx b/Source/cmStandardLevelResolver.cxx
index c418b09..50510e4 100644
--- a/Source/cmStandardLevelResolver.cxx
+++ b/Source/cmStandardLevelResolver.cxx
@@ -117,7 +117,7 @@ struct StanardLevelComputer
int defaultValue = -1;
try {
standardValue = atoi((standardStr).c_str());
- defaultValue = std::stoi(*defaultStd);
+ defaultValue = atoi((*defaultStd).c_str());
} catch (std::invalid_argument&) {
// fall through as we want an error
// when we can't find the bad value in the `stds` vector
@@ -195,7 +195,7 @@ struct StanardLevelComputer
if (existingStandard) {
existingLevelIter =
std::find(cm::cbegin(this->Levels), cm::cend(this->Levels),
- std::stoi(*existingStandard));
+ atoi((*existingStandard).c_str()));
if (existingLevelIter == cm::cend(this->Levels)) {
const std::string e =
cmStrCat("The ", this->Language, "_STANDARD property on target \"",
@@ -240,7 +240,7 @@ struct StanardLevelComputer
}
// convert defaultStandard to an integer
if (std::find(cm::cbegin(this->Levels), cm::cend(this->Levels),
- std::stoi(*defaultStandard)) == cm::cend(this->Levels)) {
+ atoi((*defaultStandard).c_str())) == cm::cend(this->Levels)) {
const std::string e = cmStrCat("The CMAKE_", this->Language,
"_STANDARD_DEFAULT variable contains an "
"invalid value: \"",
@@ -257,7 +257,7 @@ struct StanardLevelComputer
auto existingLevelIter =
std::find(cm::cbegin(this->Levels), cm::cend(this->Levels),
- std::stoi(*existingStandard));
+ atoi((*existingStandard).c_str()));
if (existingLevelIter == cm::cend(this->Levels)) {
const std::string e =
cmStrCat("The ", this->Language, "_STANDARD property on target \"",
--
2.30.1

View file

@ -1,113 +0,0 @@
From a624e066281d23fe8d5e36768e15ddf847693179 Mon Sep 17 00:00:00 2001
From: AnotherTest <ali.mpfard@gmail.com>
Date: Thu, 11 Feb 2021 21:04:56 +0330
Subject: [PATCH 04/11] snprintf!
---
Modules/FindCUDA/select_compute_arch.cmake | 2 +-
Source/cmProjectCommand.cxx | 2 +-
Source/cmStringAlgorithms.cxx | 2 +-
Tests/RunCMake/Android/android.cxx | 2 +-
Utilities/cmjsoncpp/src/lib_json/json_reader.cpp | 4 ++--
Utilities/cmjsoncpp/src/lib_json/json_writer.cpp | 4 ++--
6 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/Modules/FindCUDA/select_compute_arch.cmake b/Modules/FindCUDA/select_compute_arch.cmake
index 9351288..6b31fc2 100644
--- a/Modules/FindCUDA/select_compute_arch.cmake
+++ b/Modules/FindCUDA/select_compute_arch.cmake
@@ -132,7 +132,7 @@ function(CUDA_DETECT_INSTALLED_GPUS OUT_VARIABLE)
" {\n"
" cudaDeviceProp prop;\n"
" if (cudaSuccess == cudaGetDeviceProperties(&prop, device))\n"
- " std::printf(\"%d.%d \", prop.major, prop.minor);\n"
+ " printf(\"%d.%d \", prop.major, prop.minor);\n"
" }\n"
" return 0;\n"
"}\n")
diff --git a/Source/cmProjectCommand.cxx b/Source/cmProjectCommand.cxx
index f8678b9..05a76ad 100644
--- a/Source/cmProjectCommand.cxx
+++ b/Source/cmProjectCommand.cxx
@@ -237,7 +237,7 @@ bool cmProjectCommand(std::vector<std::string> const& args,
&v[2], &v[3]);
for (auto i = 0u; i < MAX_VERSION_COMPONENTS; ++i) {
if (int(i) < vc) {
- std::sprintf(vb[i], "%u", v[i]);
+ sprintf(vb[i], "%u", v[i]);
version_string += &"."[std::size_t(i == 0)];
version_string += vb[i];
version_components[i] = vb[i];
diff --git a/Source/cmStringAlgorithms.cxx b/Source/cmStringAlgorithms.cxx
index e0af281..f0a50cc 100644
--- a/Source/cmStringAlgorithms.cxx
+++ b/Source/cmStringAlgorithms.cxx
@@ -152,7 +152,7 @@ template <std::size_t N, typename T>
inline void MakeDigits(cm::string_view& view, char (&digits)[N],
const char* pattern, T value)
{
- int res = std::snprintf(digits, N, pattern, value);
+ int res = snprintf(digits, N, pattern, value);
if (res > 0 && res < static_cast<int>(N)) {
view = cm::string_view(digits, static_cast<std::size_t>(res));
}
diff --git a/Tests/RunCMake/Android/android.cxx b/Tests/RunCMake/Android/android.cxx
index a6d8c55..f47611e 100644
--- a/Tests/RunCMake/Android/android.cxx
+++ b/Tests/RunCMake/Android/android.cxx
@@ -20,7 +20,7 @@ int main()
{
#if !defined(STL_NONE)
// Require -lm implied by linking as C++.
- std::printf("%p\n", static_cast<double (*)(double)>(&std::sin));
+ printf("%p\n", static_cast<double (*)(double)>(&std::sin));
#endif
#if defined(STL_NONE)
return 0;
diff --git a/Utilities/cmjsoncpp/src/lib_json/json_reader.cpp b/Utilities/cmjsoncpp/src/lib_json/json_reader.cpp
index 6eeba0e..80389e5 100644
--- a/Utilities/cmjsoncpp/src/lib_json/json_reader.cpp
+++ b/Utilities/cmjsoncpp/src/lib_json/json_reader.cpp
@@ -24,7 +24,7 @@
#if !defined(WINCE) && defined(__STDC_SECURE_LIB__) && _MSC_VER >= 1500 // VC++ 9.0 and above
#define snprintf sprintf_s
#elif _MSC_VER >= 1900 // VC++ 14.0 and above
-#define snprintf std::snprintf
+#define snprintf snprintf
#else
#define snprintf _snprintf
#endif
@@ -32,7 +32,7 @@
#define snprintf snprintf
#elif __cplusplus >= 201103L
#if !defined(__MINGW32__) && !defined(__CYGWIN__)
-#define snprintf std::snprintf
+#define snprintf snprintf
#endif
#endif
diff --git a/Utilities/cmjsoncpp/src/lib_json/json_writer.cpp b/Utilities/cmjsoncpp/src/lib_json/json_writer.cpp
index fc86505..abaa661 100644
--- a/Utilities/cmjsoncpp/src/lib_json/json_writer.cpp
+++ b/Utilities/cmjsoncpp/src/lib_json/json_writer.cpp
@@ -50,7 +50,7 @@
#if !defined(WINCE) && defined(__STDC_SECURE_LIB__) && _MSC_VER >= 1500 // VC++ 9.0 and above
#define snprintf sprintf_s
#elif _MSC_VER >= 1900 // VC++ 14.0 and above
-#define snprintf std::snprintf
+#define snprintf snprintf
#else
#define snprintf _snprintf
#endif
@@ -58,7 +58,7 @@
#define snprintf snprintf
#elif __cplusplus >= 201103L
#if !defined(__MINGW32__) && !defined(__CYGWIN__)
-#define snprintf std::snprintf
+#define snprintf snprintf
#endif
#endif
--
2.30.1

View file

@ -1,207 +0,0 @@
From edc401ceb014f8ec5d80d3d2b7b7e9c1e86a27ed Mon Sep 17 00:00:00 2001
From: AnotherTest <ali.mpfard@gmail.com>
Date: Thu, 11 Feb 2021 21:22:45 +0330
Subject: [PATCH 05/11] stod
---
Help/guide/importing-exporting/Downstream/main.cc | 2 +-
Help/guide/importing-exporting/DownstreamComponents/main.cc | 2 +-
Help/guide/tutorial/Complete/tutorial.cxx | 2 +-
Help/guide/tutorial/Step10/tutorial.cxx | 2 +-
Help/guide/tutorial/Step11/tutorial.cxx | 2 +-
Help/guide/tutorial/Step12/tutorial.cxx | 2 +-
Help/guide/tutorial/Step2/tutorial.cxx | 2 +-
Help/guide/tutorial/Step3/tutorial.cxx | 2 +-
Help/guide/tutorial/Step4/tutorial.cxx | 2 +-
Help/guide/tutorial/Step5/tutorial.cxx | 2 +-
Help/guide/tutorial/Step6/tutorial.cxx | 2 +-
Help/guide/tutorial/Step7/tutorial.cxx | 2 +-
Help/guide/tutorial/Step8/tutorial.cxx | 2 +-
Help/guide/tutorial/Step9/tutorial.cxx | 2 +-
14 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/Help/guide/importing-exporting/Downstream/main.cc b/Help/guide/importing-exporting/Downstream/main.cc
index 8574373..0956348 100644
--- a/Help/guide/importing-exporting/Downstream/main.cc
+++ b/Help/guide/importing-exporting/Downstream/main.cc
@@ -12,7 +12,7 @@ int main(int argc, char* argv[])
}
// convert input to double
- const double inputValue = std::stod(argv[1]);
+ const double inputValue = strtod(argv[1].c_str(), nullptr);
// calculate square root
const double sqrt = MathFunctions::sqrt(inputValue);
diff --git a/Help/guide/importing-exporting/DownstreamComponents/main.cc b/Help/guide/importing-exporting/DownstreamComponents/main.cc
index f5e8fa6..9f8be40 100644
--- a/Help/guide/importing-exporting/DownstreamComponents/main.cc
+++ b/Help/guide/importing-exporting/DownstreamComponents/main.cc
@@ -13,7 +13,7 @@ int main(int argc, char* argv[])
}
// convert input to double
- const double inputValue = std::stod(argv[1]);
+ const double inputValue = strtod(argv[1].c_str(), nullptr);
// calculate square root
const double sqrt = MathFunctions::sqrt(inputValue);
diff --git a/Help/guide/tutorial/Complete/tutorial.cxx b/Help/guide/tutorial/Complete/tutorial.cxx
index a4f44d5..06627a9 100644
--- a/Help/guide/tutorial/Complete/tutorial.cxx
+++ b/Help/guide/tutorial/Complete/tutorial.cxx
@@ -16,7 +16,7 @@ int main(int argc, char* argv[])
}
// convert input to double
- const double inputValue = std::stod(argv[1]);
+ const double inputValue = strtod(argv[1].c_str(), nullptr);
const double outputValue = mathfunctions::sqrt(inputValue);
diff --git a/Help/guide/tutorial/Step10/tutorial.cxx b/Help/guide/tutorial/Step10/tutorial.cxx
index 37a0333..553f35a 100644
--- a/Help/guide/tutorial/Step10/tutorial.cxx
+++ b/Help/guide/tutorial/Step10/tutorial.cxx
@@ -17,7 +17,7 @@ int main(int argc, char* argv[])
}
// convert input to double
- const double inputValue = std::stod(argv[1]);
+ const double inputValue = strtod(argv[1].c_str(), nullptr);
const double outputValue = mathfunctions::sqrt(inputValue);
diff --git a/Help/guide/tutorial/Step11/tutorial.cxx b/Help/guide/tutorial/Step11/tutorial.cxx
index a4f44d5..06627a9 100644
--- a/Help/guide/tutorial/Step11/tutorial.cxx
+++ b/Help/guide/tutorial/Step11/tutorial.cxx
@@ -16,7 +16,7 @@ int main(int argc, char* argv[])
}
// convert input to double
- const double inputValue = std::stod(argv[1]);
+ const double inputValue = strtod(argv[1].c_str(), nullptr);
const double outputValue = mathfunctions::sqrt(inputValue);
diff --git a/Help/guide/tutorial/Step12/tutorial.cxx b/Help/guide/tutorial/Step12/tutorial.cxx
index a4f44d5..06627a9 100644
--- a/Help/guide/tutorial/Step12/tutorial.cxx
+++ b/Help/guide/tutorial/Step12/tutorial.cxx
@@ -16,7 +16,7 @@ int main(int argc, char* argv[])
}
// convert input to double
- const double inputValue = std::stod(argv[1]);
+ const double inputValue = strtod(argv[1].c_str(), nullptr);
const double outputValue = mathfunctions::sqrt(inputValue);
diff --git a/Help/guide/tutorial/Step2/tutorial.cxx b/Help/guide/tutorial/Step2/tutorial.cxx
index 53b0810..7ab6adb 100644
--- a/Help/guide/tutorial/Step2/tutorial.cxx
+++ b/Help/guide/tutorial/Step2/tutorial.cxx
@@ -16,7 +16,7 @@ int main(int argc, char* argv[])
}
// convert input to double
- const double inputValue = std::stod(argv[1]);
+ const double inputValue = strtod(argv[1].c_str(), nullptr);
// calculate square root
const double outputValue = sqrt(inputValue);
diff --git a/Help/guide/tutorial/Step3/tutorial.cxx b/Help/guide/tutorial/Step3/tutorial.cxx
index b3c6a4f..7bfb60b 100644
--- a/Help/guide/tutorial/Step3/tutorial.cxx
+++ b/Help/guide/tutorial/Step3/tutorial.cxx
@@ -21,7 +21,7 @@ int main(int argc, char* argv[])
}
// convert input to double
- const double inputValue = std::stod(argv[1]);
+ const double inputValue = strtod(argv[1].c_str(), nullptr);
// which square root function should we use?
#ifdef USE_MYMATH
diff --git a/Help/guide/tutorial/Step4/tutorial.cxx b/Help/guide/tutorial/Step4/tutorial.cxx
index b3c6a4f..7bfb60b 100644
--- a/Help/guide/tutorial/Step4/tutorial.cxx
+++ b/Help/guide/tutorial/Step4/tutorial.cxx
@@ -21,7 +21,7 @@ int main(int argc, char* argv[])
}
// convert input to double
- const double inputValue = std::stod(argv[1]);
+ const double inputValue = strtod(argv[1].c_str(), nullptr);
// which square root function should we use?
#ifdef USE_MYMATH
diff --git a/Help/guide/tutorial/Step5/tutorial.cxx b/Help/guide/tutorial/Step5/tutorial.cxx
index b3c6a4f..7bfb60b 100644
--- a/Help/guide/tutorial/Step5/tutorial.cxx
+++ b/Help/guide/tutorial/Step5/tutorial.cxx
@@ -21,7 +21,7 @@ int main(int argc, char* argv[])
}
// convert input to double
- const double inputValue = std::stod(argv[1]);
+ const double inputValue = strtod(argv[1].c_str(), nullptr);
// which square root function should we use?
#ifdef USE_MYMATH
diff --git a/Help/guide/tutorial/Step6/tutorial.cxx b/Help/guide/tutorial/Step6/tutorial.cxx
index b3c6a4f..7bfb60b 100644
--- a/Help/guide/tutorial/Step6/tutorial.cxx
+++ b/Help/guide/tutorial/Step6/tutorial.cxx
@@ -21,7 +21,7 @@ int main(int argc, char* argv[])
}
// convert input to double
- const double inputValue = std::stod(argv[1]);
+ const double inputValue = strtod(argv[1].c_str(), nullptr);
// which square root function should we use?
#ifdef USE_MYMATH
diff --git a/Help/guide/tutorial/Step7/tutorial.cxx b/Help/guide/tutorial/Step7/tutorial.cxx
index b3c6a4f..7bfb60b 100644
--- a/Help/guide/tutorial/Step7/tutorial.cxx
+++ b/Help/guide/tutorial/Step7/tutorial.cxx
@@ -21,7 +21,7 @@ int main(int argc, char* argv[])
}
// convert input to double
- const double inputValue = std::stod(argv[1]);
+ const double inputValue = strtod(argv[1].c_str(), nullptr);
// which square root function should we use?
#ifdef USE_MYMATH
diff --git a/Help/guide/tutorial/Step8/tutorial.cxx b/Help/guide/tutorial/Step8/tutorial.cxx
index b3c6a4f..7bfb60b 100644
--- a/Help/guide/tutorial/Step8/tutorial.cxx
+++ b/Help/guide/tutorial/Step8/tutorial.cxx
@@ -21,7 +21,7 @@ int main(int argc, char* argv[])
}
// convert input to double
- const double inputValue = std::stod(argv[1]);
+ const double inputValue = strtod(argv[1].c_str(), nullptr);
// which square root function should we use?
#ifdef USE_MYMATH
diff --git a/Help/guide/tutorial/Step9/tutorial.cxx b/Help/guide/tutorial/Step9/tutorial.cxx
index b3c6a4f..7bfb60b 100644
--- a/Help/guide/tutorial/Step9/tutorial.cxx
+++ b/Help/guide/tutorial/Step9/tutorial.cxx
@@ -21,7 +21,7 @@ int main(int argc, char* argv[])
}
// convert input to double
- const double inputValue = std::stod(argv[1]);
+ const double inputValue = strtod(argv[1].c_str(), nullptr);
// which square root function should we use?
#ifdef USE_MYMATH
--
2.30.1

View file

@ -1,93 +0,0 @@
From fbb008a5185a002c89c2ce3c3b1cf15042635d91 Mon Sep 17 00:00:00 2001
From: AnotherTest <ali.mpfard@gmail.com>
Date: Thu, 11 Feb 2021 21:24:11 +0330
Subject: [PATCH 06/11] stoll
---
Source/LexerParser/cmCTestResourceGroupsLexer.cxx | 4 ++--
Source/LexerParser/cmCTestResourceGroupsLexer.in.l | 4 ++--
Source/LexerParser/cmExprLexer.cxx | 4 ++--
Source/LexerParser/cmExprLexer.in.l | 4 ++--
4 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/Source/LexerParser/cmCTestResourceGroupsLexer.cxx b/Source/LexerParser/cmCTestResourceGroupsLexer.cxx
index de07c46..3f59b61 100644
--- a/Source/LexerParser/cmCTestResourceGroupsLexer.cxx
+++ b/Source/LexerParser/cmCTestResourceGroupsLexer.cxx
@@ -992,14 +992,14 @@ YY_RULE_SETUP
{
BEGIN(RESOURCE_GROUPS_END);
- std::size_t len = yyleng;
- yyextra->SetProcessCount(std::stoll(yytext, &len, 10));
+ char* end = nullptr;
+ yyextra->SetProcessCount(strtoll(yytext, &end, 10));
}
YY_BREAK
case 3:
YY_RULE_SETUP
{
BEGIN(RESOURCE_END);
- std::size_t len = yyleng;
- yyextra->SetNeededSlots(std::stoll(yytext, &len, 10));
+ char* end = nullptr;
+ yyextra->SetNeededSlots(strtoll(yytext, &end, 10));
yyextra->WriteRequirement();
}
diff --git a/Source/LexerParser/cmCTestResourceGroupsLexer.in.l b/Source/LexerParser/cmCTestResourceGroupsLexer.in.l
index 2aabea4..ca5f3e5 100644
--- a/Source/LexerParser/cmCTestResourceGroupsLexer.in.l
+++ b/Source/LexerParser/cmCTestResourceGroupsLexer.in.l
@@ -55,13 +55,13 @@ IDENTIFIER [a-z_][a-z0-9_]*
<INITIAL,RESOURCE_GROUPS_START>{NUMBER} {
BEGIN(RESOURCE_GROUPS_END);
- std::size_t len = yyleng;
- yyextra->SetProcessCount(std::stoll(yytext, &len, 10));
+ char* end = nullptr;
+ yyextra->SetNeededSlots(strtoll(yytext, &end, 10));
}
<RESOURCE_COUNT>{NUMBER} {
BEGIN(RESOURCE_END);
- std::size_t len = yyleng;
- yyextra->SetNeededSlots(std::stoll(yytext, &len, 10));
+ char* end = nullptr;
+ yyextra->SetNeededSlots(strtoll(yytext, &end, 10));
yyextra->WriteRequirement();
}
diff --git a/Source/LexerParser/cmExprLexer.cxx b/Source/LexerParser/cmExprLexer.cxx
index 72e59b6..6b743e0 100644
--- a/Source/LexerParser/cmExprLexer.cxx
+++ b/Source/LexerParser/cmExprLexer.cxx
@@ -992,11 +992,11 @@ YY_RULE_SETUP
YY_BREAK
case 2:
YY_RULE_SETUP
-{ yylvalp->Number = std::stoll(yytext, nullptr, 10); return exp_NUMBER; }
+{ yylvalp->Number = strtoll(yytext, nullptr, 10); return exp_NUMBER; }
YY_BREAK
case 3:
YY_RULE_SETUP
-{ yylvalp->Number = std::stoll(yytext, nullptr, 16); return exp_NUMBER; }
+{ yylvalp->Number = strtoll(yytext, nullptr, 16); return exp_NUMBER; }
YY_BREAK
case 4:
YY_RULE_SETUP
diff --git a/Source/LexerParser/cmExprLexer.in.l b/Source/LexerParser/cmExprLexer.in.l
index f8a4224..822aaf5 100644
--- a/Source/LexerParser/cmExprLexer.in.l
+++ b/Source/LexerParser/cmExprLexer.in.l
@@ -44,8 +44,8 @@ Modify cmExprLexer.cxx:
%%
[ \t] {}
-[0-9][0-9]* { yylvalp->Number = std::stoll(yytext, nullptr, 10); return exp_NUMBER; }
-0[xX][0-9a-fA-F][0-9a-fA-F]* { yylvalp->Number = std::stoll(yytext, nullptr, 16); return exp_NUMBER; }
+[0-9][0-9]* { yylvalp->Number = strtoll(yytext, nullptr, 10); return exp_NUMBER; }
+0[xX][0-9a-fA-F][0-9a-fA-F]* { yylvalp->Number = strtoll(yytext, nullptr, 16); return exp_NUMBER; }
"+" { return exp_PLUS; }
"-" { return exp_MINUS; }
--
2.30.1

View file

@ -1,145 +0,0 @@
From dc70b3830887eea5f28e3e626b4c4ef492d77ce0 Mon Sep 17 00:00:00 2001
From: AnotherTest <ali.mpfard@gmail.com>
Date: Thu, 11 Feb 2021 21:40:57 +0330
Subject: [PATCH 07/11] utimes->utime
---
Source/kwsys/CMakeLists.txt | 2 +-
Source/kwsys/SystemTools.cxx | 4 ++--
Source/kwsys/kwsysPlatformTestsCXX.cxx | 2 +-
Utilities/cmlibarchive/CMakeLists.txt | 2 +-
Utilities/cmlibarchive/build/cmake/config.h.in | 2 +-
.../cmlibarchive/libarchive/archive_read_disk_posix.c | 2 +-
.../cmlibarchive/libarchive/archive_write_disk_posix.c | 8 ++++----
Utilities/cmlibuv/src/unix/fs.c | 2 +-
8 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/Source/kwsys/CMakeLists.txt b/Source/kwsys/CMakeLists.txt
index 77adae2..52bc809 100644
--- a/Source/kwsys/CMakeLists.txt
+++ b/Source/kwsys/CMakeLists.txt
@@ -431,7 +431,7 @@ if(KWSYS_USE_SystemTools)
KWSYS_PLATFORM_CXX_TEST(KWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H
"Checking whether CXX compiler has environ in stdlib.h" DIRECT)
KWSYS_PLATFORM_CXX_TEST(KWSYS_CXX_HAS_UTIMES
- "Checking whether CXX compiler has utimes" DIRECT)
+ "Checking whether CXX compiler has utime" DIRECT)
KWSYS_PLATFORM_CXX_TEST(KWSYS_CXX_HAS_UTIMENSAT
"Checking whether CXX compiler has utimensat" DIRECT)
KWSYS_PLATFORM_CXX_TEST(KWSYS_CXX_STAT_HAS_ST_MTIM
diff --git a/Source/kwsys/SystemTools.cxx b/Source/kwsys/SystemTools.cxx
index fbe7ed9..b0c6d5c 100644
--- a/Source/kwsys/SystemTools.cxx
+++ b/Source/kwsys/SystemTools.cxx
@@ -1445,8 +1445,8 @@ bool SystemTools::Touch(const std::string& filename, bool create)
return false;
}
#else
- // fall back to utimes
- if (utimes(filename.c_str(), nullptr) < 0) {
+ // fall back to utime
+ if (utime(filename.c_str(), nullptr) < 0) {
return false;
}
#endif
diff --git a/Source/kwsys/kwsysPlatformTestsCXX.cxx b/Source/kwsys/kwsysPlatformTestsCXX.cxx
index 195a461..f5f50b4 100644
--- a/Source/kwsys/kwsysPlatformTestsCXX.cxx
+++ b/Source/kwsys/kwsysPlatformTestsCXX.cxx
@@ -82,7 +82,7 @@ int main()
int main()
{
struct timeval* current_time = 0;
- return utimes("/example", current_time);
+ return utime("/example", current_time);
}
#endif
diff --git a/Utilities/cmlibarchive/CMakeLists.txt b/Utilities/cmlibarchive/CMakeLists.txt
index 9d6f9a2..c49043a 100644
--- a/Utilities/cmlibarchive/CMakeLists.txt
+++ b/Utilities/cmlibarchive/CMakeLists.txt
@@ -1411,7 +1411,7 @@ CHECK_FUNCTION_EXISTS_GLIBC(tzset HAVE_TZSET)
CHECK_FUNCTION_EXISTS_GLIBC(unlinkat HAVE_UNLINKAT)
CHECK_FUNCTION_EXISTS_GLIBC(unsetenv HAVE_UNSETENV)
CHECK_FUNCTION_EXISTS_GLIBC(utime HAVE_UTIME)
-CHECK_FUNCTION_EXISTS_GLIBC(utimes HAVE_UTIMES)
+CHECK_FUNCTION_EXISTS_GLIBC(utime HAVE_UTIMES)
CHECK_FUNCTION_EXISTS_GLIBC(utimensat HAVE_UTIMENSAT)
CHECK_FUNCTION_EXISTS_GLIBC(vfork HAVE_VFORK)
CHECK_FUNCTION_EXISTS_GLIBC(wcrtomb HAVE_WCRTOMB)
diff --git a/Utilities/cmlibarchive/build/cmake/config.h.in b/Utilities/cmlibarchive/build/cmake/config.h.in
index 4c746b7..2407b94 100644
--- a/Utilities/cmlibarchive/build/cmake/config.h.in
+++ b/Utilities/cmlibarchive/build/cmake/config.h.in
@@ -916,7 +916,7 @@
/* Define to 1 if you have the `utimensat' function. */
#cmakedefine HAVE_UTIMENSAT 1
-/* Define to 1 if you have the `utimes' function. */
+/* Define to 1 if you have the `utime' function. */
#cmakedefine HAVE_UTIMES 1
/* Define to 1 if you have the <utime.h> header file. */
diff --git a/Utilities/cmlibarchive/libarchive/archive_read_disk_posix.c b/Utilities/cmlibarchive/libarchive/archive_read_disk_posix.c
index 6dd1fd9..2fa08d4 100644
--- a/Utilities/cmlibarchive/libarchive/archive_read_disk_posix.c
+++ b/Utilities/cmlibarchive/libarchive/archive_read_disk_posix.c
@@ -2043,7 +2043,7 @@ close_and_restore_time(int fd, struct tree *t, struct restore_time *rt)
#ifdef HAVE_LUTIMES
if (lutimes(rt->name, times) != 0)
#else
- if (AE_IFLNK != rt->filetype && utimes(rt->name, times) != 0)
+ if (AE_IFLNK != rt->filetype && utime(rt->name, times) != 0)
#endif
return (-1);
#endif
diff --git a/Utilities/cmlibarchive/libarchive/archive_write_disk_posix.c b/Utilities/cmlibarchive/libarchive/archive_write_disk_posix.c
index 67da3e1..157e27a 100644
--- a/Utilities/cmlibarchive/libarchive/archive_write_disk_posix.c
+++ b/Utilities/cmlibarchive/libarchive/archive_write_disk_posix.c
@@ -3365,8 +3365,8 @@ set_time(int fd, int mode, const char *name,
#elif HAVE_UTIMES
/*
- * The utimes()-family functions support µs-resolution and
- * setting times fds and symlinks. utimes() is documented as
+ * The utime()-family functions support µs-resolution and
+ * setting times fds and symlinks. utime() is documented as
* LEGACY by POSIX, futimes() and lutimes() are not described
* in POSIX.
*/
@@ -3389,7 +3389,7 @@ set_time(int fd, int mode, const char *name,
#else
if (S_ISLNK(mode))
return (0);
- return (utimes(name, times));
+ return (utime(name, times));
#endif
#elif defined(HAVE_UTIME)
@@ -3477,7 +3477,7 @@ set_times(struct archive_write_disk *a,
#ifdef HAVE_STRUCT_STAT_ST_BIRTHTIME
/*
* If you have struct stat.st_birthtime, we assume BSD
- * birthtime semantics, in which {f,l,}utimes() updates
+ * birthtime semantics, in which {f,l,}utime() updates
* birthtime to earliest mtime. So we set the time twice,
* first using the birthtime, then using the mtime. If
* birthtime == mtime, this isn't necessary, so we skip it.
diff --git a/Utilities/cmlibuv/src/unix/fs.c b/Utilities/cmlibuv/src/unix/fs.c
index 6d57cee..48c0123 100644
--- a/Utilities/cmlibuv/src/unix/fs.c
+++ b/Utilities/cmlibuv/src/unix/fs.c
@@ -1036,7 +1036,7 @@ static ssize_t uv__fs_utime(uv_fs_t* req) {
struct timeval tv[2];
tv[0] = uv__fs_to_timeval(req->atime);
tv[1] = uv__fs_to_timeval(req->mtime);
- return utimes(req->path, tv);
+ return utime(req->path, tv);
#elif defined(_AIX) \
&& !defined(_AIX71)
struct utimbuf buf;
--
2.30.1

View file

@ -1,20 +0,0 @@
--- a/Source/kwsys/SystemInformation.cxx 2021-02-12 21:49:51.581563656 +0330
+++ b/Source/kwsys/SystemInformation.cxx 2021-02-12 21:49:54.454669016 +0330
@@ -3635,7 +3635,7 @@ long long SystemInformationImplementatio
if (hostLimitEnvVarName) {
const char* hostLimitEnvVarValue = getenv(hostLimitEnvVarName);
if (hostLimitEnvVarValue) {
- long long hostLimit = std::atoll(hostLimitEnvVarValue);
+ long long hostLimit = atoll(hostLimitEnvVarValue);
if (hostLimit > 0) {
memTotal = min(hostLimit, memTotal);
}
@@ -3659,7 +3659,7 @@ long long SystemInformationImplementatio
if (procLimitEnvVarName) {
const char* procLimitEnvVarValue = getenv(procLimitEnvVarName);
if (procLimitEnvVarValue) {
- long long procLimit = std::atoll(procLimitEnvVarValue);
+ long long procLimit = atoll(procLimitEnvVarValue);
if (procLimit > 0) {
memAvail = min(procLimit, memAvail);
}

View file

@ -1,13 +0,0 @@
--- a/Utilities/cmjsoncpp/src/lib_json/json_writer.cpp 2021-02-12 22:35:57.078226288 +0330
+++ b/Utilities/cmjsoncpp/src/lib_json/json_writer.cpp 2021-02-12 22:36:02.937764094 +0330
@@ -41,7 +41,9 @@
#endif
#else
#include <cmath>
-#if !(defined(__QNXNTO__)) // QNX already defines isfinite
+#if defined(__serenity__) // isfinite is already defined in math.h
+#include <math.h>
+#elif !(defined(__QNXNTO__)) // QNX already defines isfinite
#define isfinite std::isfinite
#endif
#endif

View file

@ -1,370 +0,0 @@
diff --git a/Source/cmQtAutoGenerator.cxx b/Source/cmQtAutoGenerator.cxx
index ee2bc09..a1c5821 100644
--- a/Source/cmQtAutoGenerator.cxx
+++ b/Source/cmQtAutoGenerator.cxx
@@ -61,7 +61,9 @@ void cmQtAutoGenerator::Logger::Info(GenT genType,
std::string msg = cmStrCat(GeneratorName(genType), ": ", message,
cmHasSuffix(message, '\n') ? "" : "\n");
{
+#ifndef __serenity__
std::lock_guard<std::mutex> lock(Mutex_);
+#endif
cmSystemTools::Stdout(msg);
}
}
@@ -80,7 +82,9 @@ void cmQtAutoGenerator::Logger::Warning(GenT genType,
message, cmHasSuffix(message, '\n') ? "\n" : "\n\n");
}
{
+#ifndef __serenity__
std::lock_guard<std::mutex> lock(Mutex_);
+#endif
cmSystemTools::Stdout(msg);
}
}
@@ -92,7 +96,9 @@ void cmQtAutoGenerator::Logger::Error(GenT genType,
cmStrCat('\n', HeadLine(cmStrCat(GeneratorName(genType), " error")),
message, cmHasSuffix(message, '\n') ? "\n" : "\n\n");
{
+#ifndef __serenity__
std::lock_guard<std::mutex> lock(Mutex_);
+#endif
cmSystemTools::Stderr(msg);
}
}
@@ -108,7 +114,9 @@ void cmQtAutoGenerator::Logger::ErrorCommand(
msg += cmStrCat(HeadLine("Output"), output,
cmHasSuffix(output, '\n') ? "\n" : "\n\n");
{
+#ifndef __serenity__
std::lock_guard<std::mutex> lock(Mutex_);
+#endif
cmSystemTools::Stderr(msg);
}
}
diff --git a/Source/cmQtAutoGenerator.h b/Source/cmQtAutoGenerator.h
index b4f057d..e0970f6 100644
--- a/Source/cmQtAutoGenerator.h
+++ b/Source/cmQtAutoGenerator.h
@@ -55,7 +55,9 @@ public:
static std::string HeadLine(cm::string_view title);
private:
+#ifndef __serenity__
mutable std::mutex Mutex_;
+#endif
unsigned int Verbosity_ = 0;
bool ColorOutput_ = false;
};
diff --git a/Source/cmQtAutoMocUic.cxx b/Source/cmQtAutoMocUic.cxx
index 9cb172b..a365c96 100644
--- a/Source/cmQtAutoMocUic.cxx
+++ b/Source/cmQtAutoMocUic.cxx
@@ -586,8 +586,10 @@ private:
// -- Worker thread pool
std::atomic<bool> JobError_ = ATOMIC_VAR_INIT(false);
cmWorkerPool WorkerPool_;
+#ifndef __serenity__
// -- Concurrent processing
mutable std::mutex CMakeLibMutex_;
+#endif
};
cmQtAutoMocUicT::IncludeKeyT::IncludeKeyT(std::string const& key,
@@ -2612,7 +2614,9 @@ void cmQtAutoMocUicT::CreateParseJobs(SourceFileMapT const& sourceMap)
/** Concurrently callable implementation of cmSystemTools::CollapseFullPath */
std::string cmQtAutoMocUicT::CollapseFullPathTS(std::string const& path) const
{
+#ifndef __serenity__
std::lock_guard<std::mutex> guard(CMakeLibMutex_);
+#endif
return cmSystemTools::CollapseFullPath(path, ProjectDirs().CurrentSource);
}
diff --git a/Source/cmUVHandlePtr.cxx b/Source/cmUVHandlePtr.cxx
index df2f64e..154b816 100644
--- a/Source/cmUVHandlePtr.cxx
+++ b/Source/cmUVHandlePtr.cxx
@@ -137,16 +137,22 @@ struct uv_handle_deleter<uv_async_t>
* which is mandated by the standard for Deleter on
* shared_ptrs.
*/
+#ifndef __serenity__
std::shared_ptr<std::mutex> handleMutex;
+#endif
uv_handle_deleter()
+#ifndef __serenity__
: handleMutex(std::make_shared<std::mutex>())
+#endif
{
}
void operator()(uv_async_t* handle)
{
+#ifndef __serenity__
std::lock_guard<std::mutex> lock(*handleMutex);
+#endif
handle_default_delete(handle);
}
};
@@ -156,7 +162,9 @@ void uv_async_ptr::send()
auto deleter = std::get_deleter<uv_handle_deleter<uv_async_t>>(this->handle);
assert(deleter);
+#ifndef __serenity__
std::lock_guard<std::mutex> lock(*deleter->handleMutex);
+#endif
if (this->handle) {
uv_async_send(*this);
}
diff --git a/Source/cmWorkerPool.cxx b/Source/cmWorkerPool.cxx
index 12aba4f..a3f3897 100644
--- a/Source/cmWorkerPool.cxx
+++ b/Source/cmWorkerPool.cxx
@@ -382,10 +382,12 @@ public:
cmWorkerPoolWorker(cmWorkerPoolWorker const&) = delete;
cmWorkerPoolWorker& operator=(cmWorkerPoolWorker const&) = delete;
+#ifndef __serenity__
/**
* Set the internal thread
*/
void SetThread(std::thread&& aThread) { Thread_ = std::move(aThread); }
+#endif
/**
* Run an external process
@@ -403,13 +405,19 @@ private:
// -- Process management
struct
{
+#ifndef __serenity__
std::mutex Mutex;
+#endif
cm::uv_async_ptr Request;
+#ifndef __serenity__
std::condition_variable Condition;
+#endif
std::unique_ptr<cmUVReadOnlyProcess> ROP;
} Proc_;
// -- System thread
+#ifndef __serenity__
std::thread Thread_;
+#endif
};
cmWorkerPoolWorker::cmWorkerPoolWorker(uv_loop_t& uvLoop)
@@ -419,9 +427,11 @@ cmWorkerPoolWorker::cmWorkerPoolWorker(uv_loop_t& uvLoop)
cmWorkerPoolWorker::~cmWorkerPoolWorker()
{
+#ifndef __serenity__
if (Thread_.joinable()) {
Thread_.join();
}
+#endif
}
bool cmWorkerPoolWorker::RunProcess(cmWorkerPool::ProcessResultT& result,
@@ -433,7 +443,9 @@ bool cmWorkerPoolWorker::RunProcess(cmWorkerPool::ProcessResultT& result,
}
// Create process instance
{
+#ifndef __serenity__
std::lock_guard<std::mutex> lock(Proc_.Mutex);
+#endif
Proc_.ROP = cm::make_unique<cmUVReadOnlyProcess>();
Proc_.ROP->setup(&result, true, command, workingDirectory);
}
@@ -441,10 +453,12 @@ bool cmWorkerPoolWorker::RunProcess(cmWorkerPool::ProcessResultT& result,
Proc_.Request.send();
// Wait until the process has been finished and destroyed
{
+#ifndef __serenity__
std::unique_lock<std::mutex> ulock(Proc_.Mutex);
while (Proc_.ROP) {
Proc_.Condition.wait(ulock);
}
+#endif
}
return !result.error();
}
@@ -455,7 +469,9 @@ void cmWorkerPoolWorker::UVProcessStart(uv_async_t* handle)
bool startFailed = false;
{
auto& Proc = wrk->Proc_;
+#ifndef __serenity__
std::lock_guard<std::mutex> lock(Proc.Mutex);
+#endif
if (Proc.ROP && !Proc.ROP->IsStarted()) {
startFailed =
!Proc.ROP->start(handle->loop, [wrk] { wrk->UVProcessFinished(); });
@@ -469,12 +485,14 @@ void cmWorkerPoolWorker::UVProcessStart(uv_async_t* handle)
void cmWorkerPoolWorker::UVProcessFinished()
{
+#ifndef __serenity__
std::lock_guard<std::mutex> lock(Proc_.Mutex);
if (Proc_.ROP && (Proc_.ROP->IsFinished() || !Proc_.ROP->IsStarted())) {
Proc_.ROP.reset();
}
// Notify idling thread
Proc_.Condition.notify_one();
+#endif
}
/**
@@ -521,7 +539,9 @@ public:
cm::uv_async_ptr UVRequestEnd;
// -- Thread pool and job queue
+#ifndef __serenity__
std::mutex Mutex;
+#endif
bool Processing = false;
bool Aborting = false;
bool FenceProcessing = false;
@@ -529,8 +549,10 @@ public:
unsigned int WorkersIdle = 0;
unsigned int JobsProcessing = 0;
std::deque<cmWorkerPool::JobHandleT> Queue;
+#ifndef __serenity__
std::condition_variable Condition;
std::condition_variable ConditionFence;
+#endif
std::vector<std::unique_ptr<cmWorkerPoolWorker>> Workers;
// -- References
@@ -593,18 +615,24 @@ bool cmWorkerPoolInternal::Process()
void cmWorkerPoolInternal::Abort()
{
// Clear all jobs and set abort flag
+#ifndef __serenity__
std::lock_guard<std::mutex> guard(Mutex);
+#endif
if (!Aborting) {
// Register abort and clear queue
Aborting = true;
Queue.clear();
+#ifndef __serenity__
Condition.notify_all();
+#endif
}
}
inline bool cmWorkerPoolInternal::PushJob(cmWorkerPool::JobHandleT&& jobHandle)
{
+#ifndef __serenity__
std::lock_guard<std::mutex> guard(Mutex);
+#endif
if (Aborting) {
return false;
}
@@ -612,7 +640,9 @@ inline bool cmWorkerPoolInternal::PushJob(cmWorkerPool::JobHandleT&& jobHandle)
Queue.emplace_back(std::move(jobHandle));
// Notify an idle worker if there's one
if (WorkersIdle != 0) {
+#ifndef __serenity__
Condition.notify_one();
+#endif
}
// Return success
return true;
@@ -630,11 +660,17 @@ void cmWorkerPoolInternal::UVSlotBegin(uv_async_t* handle)
gint.Workers.emplace_back(
cm::make_unique<cmWorkerPoolWorker>(*gint.UVLoop));
}
+#ifndef __serenity__
// Start worker threads
for (unsigned int ii = 0; ii != num; ++ii) {
gint.Workers[ii]->SetThread(
std::thread(&cmWorkerPoolInternal::Work, &gint, ii));
}
+#else
+ for (unsigned int ii = 0; ii != num; ++ii) {
+ gint.Work(ii);
+ }
+#endif
}
// Destroy begin request
gint.UVRequestBegin.reset();
@@ -652,7 +688,9 @@ void cmWorkerPoolInternal::UVSlotEnd(uv_async_t* handle)
void cmWorkerPoolInternal::Work(unsigned int workerIndex)
{
cmWorkerPool::JobHandleT jobHandle;
+#ifndef __serenity__
std::unique_lock<std::mutex> uLock(Mutex);
+#endif
// Increment running workers count
++WorkersRunning;
// Enter worker main loop
@@ -664,7 +702,9 @@ void cmWorkerPoolInternal::Work(unsigned int workerIndex)
// Wait for new jobs on the main CV
if (Queue.empty()) {
++WorkersIdle;
+#ifndef __serenity__
Condition.wait(uLock);
+#endif
--WorkersIdle;
continue;
}
@@ -672,7 +712,9 @@ void cmWorkerPoolInternal::Work(unsigned int workerIndex)
// If there is a fence currently active or waiting,
// sleep on the main CV and try again.
if (FenceProcessing) {
+#ifndef __serenity__
Condition.wait(uLock);
+#endif
continue;
}
@@ -687,12 +729,16 @@ void cmWorkerPoolInternal::Work(unsigned int workerIndex)
raisedFence = true;
// Wait on the Fence CV until all pending jobs are done.
while (JobsProcessing != 0 && !Aborting) {
+#ifndef __serenity__
ConditionFence.wait(uLock);
+#endif
}
// When aborting, explicitly kick all threads alive once more.
if (Aborting) {
FenceProcessing = false;
+#ifndef __serenity__
Condition.notify_all();
+#endif
break;
}
}
@@ -700,10 +746,14 @@ void cmWorkerPoolInternal::Work(unsigned int workerIndex)
// Unlocked scope for job processing
++JobsProcessing;
{
+#ifndef __serenity__
uLock.unlock();
+#endif
jobHandle->Work(Pool, workerIndex); // Process job
jobHandle.reset(); // Destroy job
+#ifndef __serenity__
uLock.lock();
+#endif
}
--JobsProcessing;
@@ -712,12 +762,16 @@ void cmWorkerPoolInternal::Work(unsigned int workerIndex)
// is done.
if (raisedFence) {
FenceProcessing = false;
+#ifndef __serenity__
Condition.notify_all();
+#endif
}
// If fence processing is still not done, notify the
// the fencing worker when all active jobs are done.
if (FenceProcessing && JobsProcessing == 0) {
+#ifndef __serenity__
ConditionFence.notify_all();
+#endif
}
}

View file

@ -1,26 +0,0 @@
diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx
index 5e40712..972927b 100644
--- a/Source/cmFileCommand.cxx
+++ b/Source/cmFileCommand.cxx
@@ -1500,7 +1500,7 @@ public:
long OldPercentage = this->CurrentPercentage;
if (total > 0.0) {
- this->CurrentPercentage = std::lround(value / total * 100.0);
+ this->CurrentPercentage = trunc(round(value / total * 100.0));
if (this->CurrentPercentage > 100) {
// Avoid extra progress reports for unexpected data beyond total.
this->CurrentPercentage = 100;
diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx
index 4d1a589..0209bec 100644
--- a/Source/CTest/cmCTestTestHandler.cxx
+++ b/Source/CTest/cmCTestTestHandler.cxx
@@ -581,7 +581,7 @@ void cmCTestTestHandler::LogTestSummary(const std::vector<std::string>& passed,
}
cmCTestLog(this->CTest, HANDLER_OUTPUT,
std::endl
- << passColorCode << std::lround(percent) << "% tests passed"
+ << passColorCode << trunc(round(percent)) << "% tests passed"
<< this->CTest->GetColorCode(cmCTest::Color::CLEAR_COLOR)
<< ", " << failedColorCode << failed.size() << " tests failed"
<< this->CTest->GetColorCode(cmCTest::Color::CLEAR_COLOR)

View file

@ -1,85 +0,0 @@
diff --git a/Source/cmServer.cxx b/Source/cmServer.cxx
index 7f97406..bebb100 100644
--- a/Source/cmServer.cxx
+++ b/Source/cmServer.cxx
@@ -251,7 +251,9 @@ cmFileMonitor* cmServer::FileMonitor() const
void cmServer::WriteJsonObject(const Json::Value& jsonValue,
const DebugInfo* debug) const
{
+#if 0
cm::shared_lock<cm::shared_mutex> lock(ConnectionsMutex);
+#endif
for (auto& connection : this->Connections) {
WriteJsonObject(connection.get(), jsonValue, debug);
}
@@ -458,7 +460,9 @@ bool cmServerBase::Serve(std::string* errorMessage)
OnServeStart();
{
+#if 0
cm::shared_lock<cm::shared_mutex> lock(ConnectionsMutex);
+#endif
for (auto& connection : Connections) {
if (!connection->OnServeStart(errorMessage)) {
return false;
@@ -494,7 +498,9 @@ void cmServerBase::StartShutDown()
SIGHUPHandler.reset();
{
+#if 0
std::unique_lock<cm::shared_mutex> lock(ConnectionsMutex);
+#endif
for (auto& connection : Connections) {
connection->OnConnectionShuttingDown();
}
@@ -541,7 +547,9 @@ cmServerBase::~cmServerBase()
void cmServerBase::AddNewConnection(cmConnection* ownedConnection)
{
{
+#if 0
std::unique_lock<cm::shared_mutex> lock(ConnectionsMutex);
+#endif
Connections.emplace_back(ownedConnection);
}
ownedConnection->SetServer(this);
@@ -558,7 +566,9 @@ void cmServerBase::OnDisconnect(cmConnection* pConnection)
return m.get() == pConnection;
};
{
+#if 0
std::unique_lock<cm::shared_mutex> lock(ConnectionsMutex);
+#endif
Connections.erase(
std::remove_if(Connections.begin(), Connections.end(), pred),
Connections.end());
diff --git a/Source/cmServer.h b/Source/cmServer.h
index 9543329..6a19be7 100644
--- a/Source/cmServer.h
+++ b/Source/cmServer.h
@@ -65,7 +65,9 @@ public:
void OnDisconnect(cmConnection* pConnection);
protected:
+#if 0
mutable cm::shared_mutex ConnectionsMutex;
+#endif
std::vector<std::unique_ptr<cmConnection>> Connections;
bool ServeThreadRunning = false;
diff --git a/Utilities/std/cm/shared_mutex b/Utilities/std/cm/shared_mutex
index a1204fa..d4812c8 100644
--- a/Utilities/std/cm/shared_mutex
+++ b/Utilities/std/cm/shared_mutex
@@ -5,6 +5,7 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#pragma once
+#if 0
#if __cplusplus >= 201402L || defined(_MSVC_LANG) && _MSVC_LANG >= 201402L
# define CMake_HAVE_CXX_SHARED_LOCK
#endif
@@ -71,3 +72,4 @@ public:
};
#endif
}
+#endif

View file

@ -11,46 +11,6 @@ This patch is a big hack to wipe wide strings out of the codebase; naturally, it
- [X] Resolves issue(s) with our side of things
- [X] Hack
## `0002-stoi-atoi.patch` and `0003-stoi-atoi-2.patch`
For some reason, our libstdc++ does not define `std::stoi`, these two patches change different overloads of this function to the equivalent C functions.
### Status
- [X] Local?
- [ ] Should be merged to upstream?
- [X] Resolves issue(s) with our side of things
- [ ] Hack
## `0004-snprintf.patch`
Our libstdc++ does not define `std::printf` and `std::snprintf`, this patch simply removes the `std` namespace.
### Status
- [X] Local?
- [ ] Should be merged to upstream?
- [X] Resolves issue(s) with our side of things
- [ ] Hack
## `0005-stod.patch` and `0006-stoll.patch`
Our libstdc++ does not define `std::stod` and `std::stoll`, this patch swaps them with the equivalent C functions.
### Status
- [X] Local?
- [ ] Should be merged to upstream?
- [X] Resolves issue(s) with our side of things
- [ ] Hack
## `0007-utimes-utime.patch`
`utimes` is a deprecated POSIX API, and we do not support it, this patch uses the equivalent `utime` function instead.
### Status
- [ ] Local?
- [X] Should be merged to upstream? (Once cleaned up)
- [ ] Resolves issue(s) with our side of things
- [ ] Hack
## `0008-unix-stuff.patch`
This patch removes the use of `{get,set}priority()` as we do not support it.
@ -121,16 +81,6 @@ Everyone gets this wrong. most platforms are very lax with these includes, but w
- [ ] Resolves issue(s) with our side of things
- [ ] Hack
## `0015-atoll.patch`
Our libstdc++ does not define `std::atoll`, this patch uses the equivalent C function instead.
### Status
- [ ] Local?
- [ ] Should be merged to upstream?
- [X] Resolves issue(s) with our side of things
- [ ] Hack
## `0016-conflicting-0.patch` and `0017-conflicting-1.patch`
These two defines make GCC very sad. reasons are unknown at this time.
@ -141,16 +91,6 @@ These two defines make GCC very sad. reasons are unknown at this time.
- [X] Resolves issue(s) with our side of things
- [X] Hack
## `0018-isfinite.patch`
Our `math.h` already defines `isfinite`.
### Status
- [ ] Local?
- [X] Should be merged to upstream? If we want to have cmake support serenity out of the box.
- [ ] Resolves issue(s) with our side of things
- [ ] Hack
## `0019-libuv-so_linger.patch`
We don't have `SO_LINGER` or its associated struct. This patch removes them.
@ -161,28 +101,6 @@ We don't have `SO_LINGER` or its associated struct. This patch removes them.
- [X] Resolves issue(s) with our side of things
- [X] Hack
## `0022-remove-mutex.patch` and `0024-shared-mutex.patch`
We don't have mutexes, and out libstdc++ does not define `std::mutex`.
This patch removes all uses of `std::mutex`, `std::condition_variable`, and anything that depends on them; and replaces them with single-threaded equivalents.
This will break horribly with smp.
### Status
- [X] Local?
- [ ] Should be merged to upstream?
- [X] Resolves issue(s) with our side of things
- [X] Hack
## `0023-lround.patch`
Our libstdc++ (and stdlib) does not have `lround`, this patch replaces that with somewhat equivalent C stdlib functions.
### Status
- [X] Local?
- [ ] Should be merged to upstream?
- [X] Resolves issue(s) with our side of things
- [X] Hack
## `0025-uv-platform.patch`
This patch adds the definitions necessary to compile libuv on Serenity.