lua-users home
lua-l archive

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


Hi,

When trying to build lua (5.3) for iOS the following error is generated in loslib.c (l.151) :
> error: 'system' is unavailable: not available on iOS

Stdlib "int )system(const char*)" call is indeed prohibited for ios / watchos / tvos platforms, in order to fully compile on iOS some extra code needs to be added (was placed just before "os_execute" function definition):

**********

 #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

**********

Maybe there is a better way to handle this, hopefully this will be considered and help to move LUA library a bit closer to a full iOS / mobile platform support.

Thanks,
Bastien Commelongue