aboutsummaryrefslogtreecommitdiff
path: root/engines/sword25/util/lua
diff options
context:
space:
mode:
authorMax Lingua2014-01-24 19:27:41 -0500
committerMax Lingua2014-01-24 19:27:41 -0500
commit4592e0b586829fade4a5c800672849e693a0d151 (patch)
treed24505a169309d6c5d5b1df0ddf0c982111aaeeb /engines/sword25/util/lua
parent50bb717bccbf8b6f901f1531e93adf375ea53a5e (diff)
parent68836e00c9259b441628071f47f558e5f0bd0e45 (diff)
downloadscummvm-rg350-4592e0b586829fade4a5c800672849e693a0d151.tar.gz
scummvm-rg350-4592e0b586829fade4a5c800672849e693a0d151.tar.bz2
scummvm-rg350-4592e0b586829fade4a5c800672849e693a0d151.zip
Merge remote-tracking branch 'local/master'
Diffstat (limited to 'engines/sword25/util/lua')
-rw-r--r--engines/sword25/util/lua/loslib.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/engines/sword25/util/lua/loslib.cpp b/engines/sword25/util/lua/loslib.cpp
index 25bfa2d1b5..055dfdf19e 100644
--- a/engines/sword25/util/lua/loslib.cpp
+++ b/engines/sword25/util/lua/loslib.cpp
@@ -113,6 +113,9 @@ static int getfield (lua_State *L, const char *key, int d) {
static int os_date (lua_State *L) {
+ #ifdef __PLAYSTATION2__ // missing: gmtime & strftime
+ lua_pushnil(L);
+ #else
const char *s = luaL_optstring(L, 1, "%c");
// FIXME: Rewrite the code below to use OSystem::getTimeAndDate
// Alternatively, remove it, if sword25 does not use it.
@@ -160,6 +163,7 @@ static int os_date (lua_State *L) {
}
luaL_pushresult(&b);
}
+ #endif
return 1;
}
@@ -167,6 +171,9 @@ static int os_date (lua_State *L) {
static int os_time (lua_State *L) {
// FIXME: Rewrite the code below to use OSystem::getTimeAndDate.
// Alternatively, remove it, if sword25 does not use it.
+ #ifdef __PLAYSTATION2__ // missing: mktime
+ lua_pushnil(L);
+ #else
time_t t;
if (lua_isnoneornil(L, 1)) /* called without args? */
t = time(NULL); /* get current time */
@@ -187,6 +194,7 @@ static int os_time (lua_State *L) {
lua_pushnil(L);
else
lua_pushnumber(L, (lua_Number)t);
+ #endif
return 1;
}
@@ -195,8 +203,10 @@ static int os_difftime (lua_State *L) {
// FIXME: difftime is not portable, unfortunately.
// So we either have to replace this code, or just remove it,
// depending on whether sword25 actually uses it.
+ #ifndef __PLAYSTATION2__ // missing: difftime
lua_pushnumber(L, difftime((time_t)(luaL_checknumber(L, 1)),
(time_t)(luaL_optnumber(L, 2, 0))));
+ #endif
return 1;
}