Removed the usage of setenv to avoid portability issues.

This commit is contained in:
Robert Osfield 2006-07-17 13:16:44 +00:00
parent 2ef59b73e9
commit c1e047d549

View File

@ -25,19 +25,8 @@
#include "OrientationConverter.h" #include "OrientationConverter.h"
#if (_MSC_VER >= 1400) // Visual Studio 2005
#include <sstream>
int setenv(const char *name, const char *value, int /*rewrite*/)
{
std::stringstream sstr;
sstr<<name<<'='<<value;
return _putenv(sstr.str().c_str());
}
#endif
typedef std::vector<std::string> FileNameList; typedef std::vector<std::string> FileNameList;
class GraphicsContext { class GraphicsContext {
public: public:
GraphicsContext() GraphicsContext()
@ -452,21 +441,12 @@ int main( int argc, char **argv )
return 1; return 1;
} }
if (arguments.argc()<=1) if (arguments.argc()<=1)
{ {
arguments.getApplicationUsage()->write(std::cout,osg::ApplicationUsage::COMMAND_LINE_OPTION); arguments.getApplicationUsage()->write(std::cout,osg::ApplicationUsage::COMMAND_LINE_OPTION);
return 1; return 1;
} }
std::string options;
while(arguments.read("--optimizer",options))
{
setenv("OSG_OPTIMIZER",options.c_str(),1);
}
FileNameList fileNames; FileNameList fileNames;
OrientationConverter oc; OrientationConverter oc;
bool do_convert = false; bool do_convert = false;