lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On 9/25/17, Luiz Henrique de Figueiredo <lhf@tecgraf.puc-rio.br> wrote:
> A quick fix is to add this to luaconf.h:
>
> #define system(s) ((s)==NULL ? 0 : -1)
>
> If someone knows the correct defines that identify iOS then this should be
> something like:
>
> #if defined(__IOS__)
> #define system(s) ((s)==NULL ? 0 : -1)
> #endif
>
>


iOS has never actually allowed system() or any external process
creation. (Apple's own NSTask was always absent from the SDK.) Up
until now, system() could be linked, but nobody ever dared called it.
Many companies would already remove it to completely avoid the
possibility of Apple rejecting their apps.

And in fact, Android is pretty much the same way. Their engineers say,
"Don't ever do that." The Android process and life-cycle model is
completely alien to this model.


I recommend that both be disabled in luaconf.h by default. I believe
this is the incantation we need:


#if defined(__APPLE__)
    #include "TargetConditionals.h"
    #if TARGET_OS_IOS || TARGET_OS_WATCH || TARGET_OS_TV
        #define system(s) ((s)==NULL ? 0 : -1)
    #endif // end iOS
#elif defined(__ANDROID__)
    #define system(s) ((s)==NULL ? 0 : -1)

#endif



-Eric