Commit bb2941fc authored by Abseil Team's avatar Abseil Team Committed by Copybara-Service
Browse files

Give CreateArgvFromArgs internal linkage

It isn't declared in any header or referenced from any other file.

PiperOrigin-RevId: 531209642
Change-Id: I9e7df37f737b00994f8845ed38c3b775879cb25c
parent bc860af0
......@@ -625,9 +625,11 @@ bool DeathTestImpl::Passed(bool status_ok) {
return success;
}
#ifndef GTEST_OS_WINDOWS
// Note: The return value points into args, so the return value's lifetime is
// bound to that of args.
std::unique_ptr<char*[]> CreateArgvFromArgs(std::vector<std::string>& args) {
static std::unique_ptr<char*[]> CreateArgvFromArgs(
std::vector<std::string>& args) {
auto result = std::make_unique<char*[]>(args.size() + 1);
for (size_t i = 0; i < args.size(); ++i) {
result[i] = &args[i][0];
......@@ -635,6 +637,7 @@ std::unique_ptr<char*[]> CreateArgvFromArgs(std::vector<std::string>& args) {
result[args.size()] = nullptr; // extra null terminator
return result;
}
#endif
#ifdef GTEST_OS_WINDOWS
// WindowsDeathTest implements death tests on Windows. Due to the
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment