Fix some C++11 requirements.

This commit is contained in:
Wilson Snyder 2020-01-10 07:07:21 -05:00
parent 2982336ec2
commit 1234c83953
2 changed files with 4 additions and 4 deletions

View File

@ -1369,10 +1369,10 @@ void V3Options::parseOptsFile(FileLine* fl, const string& filename, bool rel) {
// Convert to argv style arg list and parse them // Convert to argv style arg list and parse them
std::vector<char*> argv; argv.reserve(args.size()+1); std::vector<char*> argv; argv.reserve(args.size()+1);
for (const string &arg : args) { for (std::vector<std::string>::const_iterator it = args.begin(); it != args.end(); ++it) {
argv.push_back(const_cast<char*>(arg.c_str())); argv.push_back(const_cast<char*>(it->c_str()));
} }
argv.push_back(nullptr); // argv is NULL-terminated argv.push_back(NULL); // argv is NULL-terminated
parseOptsList(fl, optdir, static_cast<int>(argv.size()-1), argv.data()); parseOptsList(fl, optdir, static_cast<int>(argv.size()-1), argv.data());
} }

View File

@ -161,7 +161,7 @@ string V3Os::filenameSubstitute(const string& filename) {
} }
string envvar = filename.substr(pos+1, endpos-pos); string envvar = filename.substr(pos+1, endpos-pos);
string envvalue; string envvalue;
if (!envvar.empty()) envvalue = getenvStr(envvar, {}); if (!envvar.empty()) envvalue = getenvStr(envvar, "");
if (!envvalue.empty()) { if (!envvalue.empty()) {
out += envvalue; out += envvalue;
if (brackets==NONE) pos = endpos; if (brackets==NONE) pos = endpos;