CONSOLE: Handle unimplemented features for console toolchains.

This commit is contained in:
Mike Pall
2012-06-09 20:54:34 +02:00
parent 9f443e8b89
commit 37be8a5478
6 changed files with 41 additions and 2 deletions

View File

@@ -47,7 +47,11 @@ static int os_pushresult(lua_State *L, int i, const char *filename)
LJLIB_CF(os_execute)
{
#if LJ_TARGET_CONSOLE
lua_pushinteger(L, -1);
#else
lua_pushinteger(L, system(luaL_optstring(L, 1, NULL)));
#endif
return 1;
}
@@ -86,7 +90,11 @@ LJLIB_CF(os_tmpname)
LJLIB_CF(os_getenv)
{
#if LJ_TARGET_CONSOLE
lua_pushnil(L);
#else
lua_pushstring(L, getenv(luaL_checkstring(L, 1))); /* if NULL push nil */
#endif
return 1;
}