| 124 | #endif |
| 125 | |
| 126 | static std::vector<std::string> get_environment() { |
| 127 | std::vector<std::string> env; |
| 128 | |
| 129 | #ifdef _WIN32 |
| 130 | LPWCH env_block = GetEnvironmentStringsW(); |
| 131 | if (!env_block) { |
| 132 | return env; |
| 133 | } |
| 134 | for (LPWCH e = env_block; *e; e += wcslen(e) + 1) { |
| 135 | env.emplace_back(wide_to_utf8(e)); |
| 136 | } |
| 137 | FreeEnvironmentStringsW(env_block); |
| 138 | #else |
| 139 | if (environ == nullptr) { |
| 140 | return env; |
| 141 | } |
| 142 | for (char ** e = environ; *e != nullptr; e++) { |
| 143 | env.emplace_back(*e); |
| 144 | } |
| 145 | #endif |
| 146 | |
| 147 | return env; |
| 148 | } |
| 149 | |
| 150 | void server_model_meta::update_args(common_preset_context & ctx_preset, std::string bin_path) { |
| 151 | // update params |
no test coverage detected