diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2023-02-02 13:43:41 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2023-02-02 13:43:41 -0300 |
| commit | cf08915d62e338c987b71c078b148490510e9fe7 (patch) | |
| tree | a70c98ab7b2edc588658a99ec3b9a3ab8077222d | |
| parent | c888ae0aea030491f90b749260a156ce15635681 (diff) | |
| download | lua-cf08915d62e338c987b71c078b148490510e9fe7.tar.gz lua-cf08915d62e338c987b71c078b148490510e9fe7.tar.bz2 lua-cf08915d62e338c987b71c078b148490510e9fe7.zip | |
New macro LUA_USE_IOS
Do not try to detect automatically whether system is iOS; it is
simpler and more reliable to let the programmer inform that.
| -rw-r--r-- | loslib.c | 17 | ||||
| -rw-r--r-- | luaconf.h | 6 |
2 files changed, 11 insertions, 12 deletions
| @@ -138,21 +138,14 @@ | |||
| 138 | /* }================================================================== */ | 138 | /* }================================================================== */ |
| 139 | 139 | ||
| 140 | 140 | ||
| 141 | /* | ||
| 142 | ** Despite claiming to be ISO, the C library in some Apple platforms | ||
| 143 | ** does not implement 'system'. | ||
| 144 | */ | ||
| 145 | #if !defined(l_system) && defined(__APPLE__) /* { */ | ||
| 146 | #include "TargetConditionals.h" | ||
| 147 | #if TARGET_OS_IOS || TARGET_OS_WATCH || TARGET_OS_TV | ||
| 148 | #define l_system(cmd) ((cmd) == NULL ? 0 : -1) | ||
| 149 | #endif | ||
| 150 | #endif /* } */ | ||
| 151 | |||
| 152 | #if !defined(l_system) | 141 | #if !defined(l_system) |
| 142 | #if defined(LUA_USE_IOS) | ||
| 143 | /* Despite claiming to be ISO C, iOS does not implement 'system'. */ | ||
| 144 | #define l_system(cmd) ((cmd) == NULL ? 0 : -1) | ||
| 145 | #else | ||
| 153 | #define l_system(cmd) system(cmd) /* default definition */ | 146 | #define l_system(cmd) system(cmd) /* default definition */ |
| 154 | #endif | 147 | #endif |
| 155 | 148 | #endif | |
| 156 | 149 | ||
| 157 | 150 | ||
| 158 | static int os_execute (lua_State *L) { | 151 | static int os_execute (lua_State *L) { |
| @@ -70,6 +70,12 @@ | |||
| 70 | #endif | 70 | #endif |
| 71 | 71 | ||
| 72 | 72 | ||
| 73 | #if defined(LUA_USE_IOS) | ||
| 74 | #define LUA_USE_POSIX | ||
| 75 | #define LUA_USE_DLOPEN | ||
| 76 | #endif | ||
| 77 | |||
| 78 | |||
| 73 | /* | 79 | /* |
| 74 | @@ LUAI_IS32INT is true iff 'int' has (at least) 32 bits. | 80 | @@ LUAI_IS32INT is true iff 'int' has (at least) 32 bits. |
| 75 | */ | 81 | */ |
