aboutsummaryrefslogtreecommitdiff
path: root/toolsrc/src/vcpkg_System.cpp
diff options
context:
space:
mode:
authorAlexander Karatarakis <alkarata@microsoft.com>2017-02-14 13:26:21 -0800
committerAlexander Karatarakis <alkarata@microsoft.com>2017-02-14 13:26:21 -0800
commit0d47ce63ed1cc5159a038de0a8446e3828b8aeeb (patch)
tree1a680c17afd3dbeece3fbd5ca37a904f7a726cbe /toolsrc/src/vcpkg_System.cpp
parentc11b2c790e0260434d057cd5fbeccd59f36732c7 (diff)
downloadvcpkg-0d47ce63ed1cc5159a038de0a8446e3828b8aeeb.tar.gz
vcpkg-0d47ce63ed1cc5159a038de0a8446e3828b8aeeb.zip
Add System::set_environmental_variable()
Diffstat (limited to 'toolsrc/src/vcpkg_System.cpp')
-rw-r--r--toolsrc/src/vcpkg_System.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/toolsrc/src/vcpkg_System.cpp b/toolsrc/src/vcpkg_System.cpp
index 1d9f8e696..e7349df69 100644
--- a/toolsrc/src/vcpkg_System.cpp
+++ b/toolsrc/src/vcpkg_System.cpp
@@ -29,7 +29,7 @@ namespace vcpkg::System
auto pipe = _wpopen(actual_cmd_line.c_str(), L"r");
if (pipe == nullptr)
{
- return {1, output};
+ return { 1, output };
}
while (fgets(buf, 1024, pipe))
{
@@ -37,10 +37,10 @@ namespace vcpkg::System
}
if (!feof(pipe))
{
- return {1, output};
+ return { 1, output };
}
auto ec = _pclose(pipe);
- return {ec, output};
+ return { ec, output };
}
void print(const char* message)
@@ -86,6 +86,11 @@ namespace vcpkg::System
return ret;
}
+ void set_environmental_variable(const wchar_t* varname, const wchar_t* varvalue) noexcept
+ {
+ _wputenv_s(varname, varvalue);
+ }
+
void Stopwatch2::start()
{
static_assert(sizeof(start_time) == sizeof(LARGE_INTEGER), "");