Hi Alessandro,

OSG_SYSTEM_SUPPORTED is really just a workaround for this iOS specific
problem, I'd rather that the C++ code itself can determine whether
system() is available or not.  There are C++ Apple directives that
could possibly used, if there are iOS ones then these instead.



Robert.

On 22 January 2018 at 15:47, Alessandro Terenzi <[email protected]> wrote:
> Ok, so, as far as I understand, OSG_SYSTEM_SUPPORTED is used only for iOS 
> related builds, right?
>
> If this is the case we could implement os_utils.cpp just like this:
>
>
> Code:
> #include <osg/os_utils>
>
> #ifndef OSG_SYSTEM_SUPPORTED
> #include <spawn.h>
> #endif
>
> extern "C" {
>
>     int osg_system(const char* command)
>     {
> #ifdef OSG_SYSTEM_SUPPORTED
>         return system(command);
> #else
>         pid_t pid;
>         posix_spawn(&pid, command, NULL, NULL, NULL, NULL);
>         return waitpid(pid, NULL, 0);
> #endif
>     }
>
> }
>
>
>
> And, in the future, if other platforms will not support system() and the 
> above code won't work we can use more defines to handle each case. Do you 
> agree?
>
> Alessandro
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=72831#72831
>
>
>
>
>
> _______________________________________________
> osg-submissions mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org

Reply via email to