Added ability to toggle on/off use of C system() function call, using OSG_SYSTEM_SUPPORTED Cmake option
This commit is contained in:
@@ -16,13 +16,29 @@
|
||||
|
||||
#include <osg/Config>
|
||||
|
||||
#ifdef OSG_ENVVAR_SUPPORTED
|
||||
#if defined(OSG_SYSTEM_SUPPORTED) || defined(OSG_ENVVAR_SUPPORTED)
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
|
||||
#ifdef OSG_ENVVAR_SUPPORTED
|
||||
#include <sstream>
|
||||
#endif
|
||||
|
||||
namespace osg {
|
||||
|
||||
#ifdef OSG_SYSTEM_SUPPORTED
|
||||
inline int system(const char* command)
|
||||
{
|
||||
return ::system(command);
|
||||
}
|
||||
#else
|
||||
inline int system(const char* command)
|
||||
{
|
||||
OSG_WARN<<"system("<<command<<") not supported on this platform."<<std::endl;
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
inline unsigned int getClampedLength(const char* str, unsigned int maxNumChars=4096)
|
||||
{
|
||||
unsigned int i = 0;
|
||||
|
||||
Reference in New Issue
Block a user