| 1481 | |
| 1482 | |
| 1483 | inline std::wstring wgetenv(const wchar_t* name) |
| 1484 | { |
| 1485 | // use a separate buffer since C++03 basic_string is not required to be contiguous |
| 1486 | const DWORD size = ::GetEnvironmentVariableW(name, nullptr, 0); |
| 1487 | if (size > 0) |
| 1488 | { |
| 1489 | std::unique_ptr< wchar_t[] > buf(new wchar_t[size]); |
| 1490 | if (BOOST_LIKELY(::GetEnvironmentVariableW(name, buf.get(), size) > 0)) |
| 1491 | return std::wstring(buf.get()); |
| 1492 | } |
| 1493 | |
| 1494 | return std::wstring(); |
| 1495 | } |
| 1496 | |
| 1497 | inline bool not_found_error(int errval) noexcept |
| 1498 | { |
no test coverage detected