diff options
author | Paul Cristian Sarbu <paul.cristian.sarbu@huawei.com> | 2024-11-11 13:27:06 +0100 |
---|---|---|
committer | Maksim Denisov <denisov.maksim@huawei.com> | 2024-11-14 14:23:06 +0100 |
commit | c2a3ec54434d9f428d8f775ecbcc85c8ab88fae8 (patch) | |
tree | a78ac10f2cdd0cfc881477b017d05d976b7f5f5e | |
parent | 94ed1751bc3054c53a197ac041d11ce80a0cf688 (diff) | |
download | justbuild-c2a3ec54434d9f428d8f775ecbcc85c8ab88fae8.tar.gz |
system: Implement IWYU suggestions
-rw-r--r-- | src/buildtool/system/system.cpp | 14 | ||||
-rw-r--r-- | src/buildtool/system/system_command.hpp | 26 |
2 files changed, 22 insertions, 18 deletions
diff --git a/src/buildtool/system/system.cpp b/src/buildtool/system/system.cpp index 228c7806..ff057d85 100644 --- a/src/buildtool/system/system.cpp +++ b/src/buildtool/system/system.cpp @@ -14,15 +14,17 @@ #include "src/buildtool/system/system.hpp" -#include <array> -#include <cstdlib> -#include <string> - +#ifdef VALGRIND_BUILD #ifdef __unix__ #include <unistd.h> #else #error "Non-unix is not supported yet" -#endif +#endif // __unix__ +#include <array> +#include <string> +#else +#include <cstdlib> +#endif // VALGRIND_BUILD void System::ExitWithoutCleanup(int exit_code) { #ifdef VALGRIND_BUILD @@ -37,5 +39,5 @@ void System::ExitWithoutCleanup(int exit_code) { ::execvpe(args[0], args.data(), nullptr); #else std::_Exit(exit_code); -#endif +#endif // VALGRIND_BUILD } diff --git a/src/buildtool/system/system_command.hpp b/src/buildtool/system/system_command.hpp index 909c047a..86f63e6b 100644 --- a/src/buildtool/system/system_command.hpp +++ b/src/buildtool/system/system_command.hpp @@ -15,26 +15,28 @@ #ifndef INCLUDED_SRC_BUILDTOOL_SYSTEM_SYSTEM_COMMAND_HPP #define INCLUDED_SRC_BUILDTOOL_SYSTEM_SYSTEM_COMMAND_HPP -#include <array> -#include <cerrno> // for errno +#ifdef __unix__ +#include <sys/types.h> +#include <sys/wait.h> +#include <unistd.h> +#else +#error "Non-unix is not supported yet" +#endif + +#include <algorithm> // for transform +#include <cerrno> // for errno #include <cstdio> -#include <cstring> // for strerror() -#include <iostream> +#include <cstdlib> // for EXIT_FAILURE, WEXITSTATUS, WIFEXITED, WIFSIGNALED, WTERMSIG +#include <cstring> // for strerror() +#include <filesystem> // for path, operator/ #include <iterator> #include <map> +#include <memory> #include <optional> -#include <sstream> #include <string> #include <utility> // std::move #include <vector> -#ifdef __unix__ -#include <sys/wait.h> -#include <unistd.h> -#else -#error "Non-unix is not supported yet" -#endif - #include "gsl/gsl" #include "src/buildtool/file_system/file_system_manager.hpp" #include "src/buildtool/logging/log_level.hpp" |