diff options
author | fredizzimo <fsundvik@gmail.com> | 2018-01-08 00:20:02 +0300 |
---|---|---|
committer | bubnikv <bubnikv@gmail.com> | 2018-01-08 00:20:02 +0300 |
commit | ad5fcce6e4fd172cb105a71b9ef658338d742f56 (patch) | |
tree | 778c61d4b34505c20b3b875f04918108af1cf1cc /xs | |
parent | fec1fcdca8805cd6db95095abdaea5952e22d513 (diff) |
Fix environment variable setting on Windows (#674)
The previous way of checking that _putenv_s is defined does not work,
because _putenv_s is a function and not a define. This is a partial
application of commit 31115e0369747b1e1c45cbe3f2a90f6dff66666a from
alexrj/Slic3r.
I tried cherry picking the whole commit, but unicode is already handled
diffrently here, so that would have been a lot of work.
Diffstat (limited to 'xs')
-rw-r--r-- | xs/src/libslic3r/Config.cpp | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/xs/src/libslic3r/Config.cpp b/xs/src/libslic3r/Config.cpp index 728ed608b..474be7237 100644 --- a/xs/src/libslic3r/Config.cpp +++ b/xs/src/libslic3r/Config.cpp @@ -18,10 +18,6 @@ #include <boost/property_tree/ini_parser.hpp> #include <string.h> -#if defined(_WIN32) && !defined(setenv) && defined(_putenv_s) -#define setenv(k, v, o) _putenv_s(k, v) -#endif - namespace Slic3r { std::string escape_string_cstyle(const std::string &str) @@ -309,7 +305,6 @@ double ConfigBase::get_abs_value(const t_config_option_key &opt_key, double rati void ConfigBase::setenv_() { -#ifdef setenv t_config_option_keys opt_keys = this->keys(); for (t_config_option_keys::const_iterator it = opt_keys.begin(); it != opt_keys.end(); ++it) { // prepend the SLIC3R_ prefix @@ -322,9 +317,8 @@ void ConfigBase::setenv_() for (size_t i = 0; i < envname.size(); ++i) envname[i] = (envname[i] <= 'z' && envname[i] >= 'a') ? envname[i]-('a'-'A') : envname[i]; - setenv(envname.c_str(), this->serialize(*it).c_str(), 1); + boost::nowide::setenv(envname.c_str(), this->serialize(*it).c_str(), 1); } -#endif } void ConfigBase::load(const std::string &file) |