aboutsummaryrefslogtreecommitdiff
path: root/loslib.c
diff options
context:
space:
mode:
Diffstat (limited to 'loslib.c')
-rw-r--r--loslib.c17
1 files changed, 5 insertions, 12 deletions
diff --git a/loslib.c b/loslib.c
index 7eb05caf..89ac06bc 100644
--- a/loslib.c
+++ b/loslib.c
@@ -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
158static int os_execute (lua_State *L) { 151static int os_execute (lua_State *L) {