Index: libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.temp_dir_path/temp_directory_path.pass.cpp =================================================================== --- libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.temp_dir_path/temp_directory_path.pass.cpp +++ libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.temp_dir_path/temp_directory_path.pass.cpp @@ -26,11 +26,19 @@ using namespace fs; void PutEnv(std::string var, fs::path value) { +#ifdef _WIN32 + assert(::_putenv((var + "=" + value.string()).c_str()) == 0); +#else assert(::setenv(var.c_str(), value.string().c_str(), /* overwrite */ 1) == 0); +#endif } void UnsetEnv(std::string var) { +#ifdef _WIN32 + assert(::_putenv((var + "=").c_str()) == 0); +#else assert(::unsetenv(var.c_str()) == 0); +#endif } TEST_SUITE(filesystem_temp_directory_path_test_suite)