| 13 | #endif |
| 14 | |
| 15 | MATERIALX_NAMESPACE_BEGIN |
| 16 | |
| 17 | string getEnviron(const string& name) |
| 18 | { |
| 19 | #if defined(_WIN32) |
| 20 | if (uint32_t size = GetEnvironmentVariableA(name.c_str(), nullptr, 0)) |
| 21 | { |
| 22 | vector<char> buffer(size); |
| 23 | GetEnvironmentVariableA(name.c_str(), buffer.data(), size); |
| 24 | return string(buffer.data()); |
| 25 | } |
| 26 | #else |
| 27 | if (const char* const result = getenv(name.c_str())) |
| 28 | { |
| 29 | return string(result); |
| 30 | } |
| 31 | #endif |
| 32 | return EMPTY_STRING; |
| 33 | } |
| 34 | |
| 35 | bool setEnviron(const string& name, const string& value) |
| 36 | { |
no test coverage detected