LocalFree(lpMsgBuf);
}
-bool set_env_var(std::string const& name, std::string const& value) {
- bool ret = SetEnvironmentVariableA(name.c_str(), value.c_str());
- if (ret == false) {
+void set_env_var(std::string const& name, std::string const& value) {
+ BOOL ret = SetEnvironmentVariableA(name.c_str(), value.c_str());
+ if (ret == 0) {
print_error_message(ERROR_SETENV_FAILED, "SetEnvironmentVariableA");
- return true;
}
- return false;
}
-bool remove_env_var(std::string const& name) { return SetEnvironmentVariableA(name.c_str(), nullptr); }
+void remove_env_var(std::string const& name) { SetEnvironmentVariableA(name.c_str(), nullptr); }
#define ENV_VAR_BUFFER_SIZE 4096
std::string get_env_var(std::string const& name, bool report_failure) {
std::string value;
}
#elif defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__)
-bool set_env_var(std::string const& name, std::string const& value) { return setenv(name.c_str(), value.c_str(), 1); }
-bool remove_env_var(std::string const& name) { return unsetenv(name.c_str()); }
+void set_env_var(std::string const& name, std::string const& value) { setenv(name.c_str(), value.c_str(), 1); }
+void remove_env_var(std::string const& name) { unsetenv(name.c_str()); }
std::string get_env_var(std::string const& name, bool report_failure) {
char* ret = getenv(name.c_str());
if (ret == nullptr) {
*/
#if defined(WIN32)
-bool set_env_var(std::string const& name, std::string const& value);
-bool remove_env_var(std::string const& name);
+void set_env_var(std::string const& name, std::string const& value);
+void remove_env_var(std::string const& name);
#define ENV_VAR_BUFFER_SIZE 4096
std::string get_env_var(std::string const& name, bool report_failure = true);
#elif defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__)
-bool set_env_var(std::string const& name, std::string const& value);
-bool remove_env_var(std::string const& name);
+void set_env_var(std::string const& name, std::string const& value);
+void remove_env_var(std::string const& name);
std::string get_env_var(std::string const& name, bool report_failure = true);
#endif
props[i].properties.minImageTransferGranularity.width = (rand() % 30) + 1;
props[i].properties.minImageTransferGranularity.height = (rand() % 30) + 1;
props[i].properties.minImageTransferGranularity.depth = (rand() % 30) + 1;
- props[i].support_present = (rand() % 2);
+ props[i].support_present = rand() % 2 == 0;
}
return static_cast<uint32_t>(props.size());
}