subprocess: Fix -Wunused-private-field for Child class on Windows
When compiling with clang-cl on Windows, `src/util/subprocess.h` emits `-Wunused-private-field` warnings about unused private fields in the `Child` class.
This commit is contained in:
1 file changed
+6
-2
@@ -738,6 +738,7 @@ private:
|
|||||||
Popen* popen_ = nullptr;
|
Popen* popen_ = nullptr;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#ifndef __USING_WINDOWS__
|
||||||
/*!
|
/*!
|
||||||
* A helper class to Popen.
|
* A helper class to Popen.
|
||||||
* This takes care of all the fork-exec logic
|
* This takes care of all the fork-exec logic
|
||||||
@@ -759,6 +760,7 @@ private:
|
|||||||
Popen* parent_ = nullptr;
|
Popen* parent_ = nullptr;
|
||||||
int err_wr_pipe_ = -1;
|
int err_wr_pipe_ = -1;
|
||||||
};
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
// Fwd Decl.
|
// Fwd Decl.
|
||||||
class Streams;
|
class Streams;
|
||||||
@@ -932,7 +934,9 @@ class Popen
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
friend struct detail::ArgumentDeducer;
|
friend struct detail::ArgumentDeducer;
|
||||||
|
#ifndef __USING_WINDOWS__
|
||||||
friend class detail::Child;
|
friend class detail::Child;
|
||||||
|
#endif
|
||||||
|
|
||||||
template <typename... Args>
|
template <typename... Args>
|
||||||
Popen(const std::string& cmd_args, Args&& ...args):
|
Popen(const std::string& cmd_args, Args&& ...args):
|
||||||
@@ -1275,8 +1279,8 @@ namespace detail {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
inline void Child::execute_child() {
|
|
||||||
#ifndef __USING_WINDOWS__
|
#ifndef __USING_WINDOWS__
|
||||||
|
inline void Child::execute_child() {
|
||||||
int sys_ret = -1;
|
int sys_ret = -1;
|
||||||
auto& stream = parent_->stream_;
|
auto& stream = parent_->stream_;
|
||||||
|
|
||||||
@@ -1336,8 +1340,8 @@ namespace detail {
|
|||||||
// Calling application would not get this
|
// Calling application would not get this
|
||||||
// exit failure
|
// exit failure
|
||||||
_exit (EXIT_FAILURE);
|
_exit (EXIT_FAILURE);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
inline void Streams::setup_comm_channels()
|
inline void Streams::setup_comm_channels()
|
||||||
|
|||||||
Reference in new issue
Block a user