I have had a bash at making a system fallback work for C and C++
compilation, it's checked in as:
https://github.com/openscenegraph/OpenSceneGraph/commit/18d5a9159f9c66336c40bf91b77dfe3ebe3af31f
In the osg/os_utils header there is now osg_system declared as a C function:
#ifdef __cplusplus
extern "C" {
#endif
/** Cross platform version of C system() function. */
extern OSG_EXPORT int osg_system(const char* str);
#ifdef __cplusplus
}
#endif
The lua plugin as well as the rest of the OSG usage of system now uses
this osg_system() function. On the implementation side I have left it
controlled by the OSG_SYSTEM_SUPPORTED cmake controlled, now
implemented in src/osg/os_utils.cpp :
extern "C" {
int osg_system(const char* command)
{
#ifdef OSG_SYSTEM_SUPPORTED
return system(command);
#else
printf("osg_system(%s) not supported.\n", command);
#endif
}
}
I'm open to the having different implementations of osg_system on
different platforms, and potentially the OSG_SYSTEM_SUPPORTED cmake +
define could be removed completely if this fallback can happen
seamlessly with the os_utils.cpp
Robert.
_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org