Fix OpenSolaris compile error.

This commit is contained in:
Wilson Snyder 2012-03-30 07:26:00 -04:00
parent aa3a417e97
commit 9165233657
2 changed files with 5 additions and 3 deletions

View File

@ -16,6 +16,8 @@ indicates the contributor was also the author of the fix; Thanks!
**** Fix and document --gdb option, bug454. [Jeremy Bennett]
**** Fix OpenSolaris compile error. [Sanjay Singh]
* Verilator 3.832 2012/03/07

View File

@ -394,13 +394,13 @@ void V3Options::setenvStr(const string& envvar, const string& value, const strin
} else {
UINFO(1,"export "<<envvar<<"="<<value<<endl);
}
#ifndef _WIN32
#if defined(_BSD_SOURCE) || (defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 200112L)
setenv(envvar.c_str(),value.c_str(),true);
#else
//setenv() replaced by putenv() in MinGW environment. Prototype is different
//setenv() replaced by putenv() in MinGW/Solaris environment. Prototype is different
//putenv() requires NAME=VALUE format
string vareq = envvar + "=" + value;
putenv(vareq.c_str());
putenv(const_cast<char*>(vareq.c_str()));
#endif
}