From c2a3ec54434d9f428d8f775ecbcc85c8ab88fae8 Mon Sep 17 00:00:00 2001 From: Paul Cristian Sarbu Date: Mon, 11 Nov 2024 13:27:06 +0100 Subject: system: Implement IWYU suggestions --- src/buildtool/system/system.cpp | 14 ++++++++------ src/buildtool/system/system_command.hpp | 26 ++++++++++++++------------ 2 files changed, 22 insertions(+), 18 deletions(-) (limited to 'src') 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 -#include -#include - +#ifdef VALGRIND_BUILD #ifdef __unix__ #include #else #error "Non-unix is not supported yet" -#endif +#endif // __unix__ +#include +#include +#else +#include +#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 -#include // for errno +#ifdef __unix__ +#include +#include +#include +#else +#error "Non-unix is not supported yet" +#endif + +#include // for transform +#include // for errno #include -#include // for strerror() -#include +#include // for EXIT_FAILURE, WEXITSTATUS, WIFEXITED, WIFSIGNALED, WTERMSIG +#include // for strerror() +#include // for path, operator/ #include #include +#include #include -#include #include #include // std::move #include -#ifdef __unix__ -#include -#include -#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" -- cgit v1.2.3