| Previous | 199869 Revisions | Next |
| r34325 Saturday 10th January, 2015 at 14:06:17 UTC by Miodrag Milanović |
|---|
| Fixed LUA compile |
| [/trunk] | makefile |
| [3rdparty/lsqlite3] | lsqlite3.c |
| [3rdparty/lua/src] | liolib.c lobject.c loslib.c lvm.c |
| [src/emu] | luaengine.c luaengine.h |
| r242836 | r242837 | |
|---|---|---|
| 31 | 31 | #include <assert.h> |
| 32 | 32 | |
| 33 | 33 | #define LUA_LIB |
| 34 | #include "lua/lua.h" | |
| 35 | #include "lua/lauxlib.h" | |
| 34 | #include "lua.h" | |
| 35 | #include "lauxlib.h" | |
| 36 | 36 | |
| 37 | 37 | #if LUA_VERSION_NUM > 501 |
| 38 | 38 | // |
| r242836 | r242837 | |
|---|---|---|
| 556 | 556 | if (op) |
| 557 | 557 | return luaL_fileresult(L, 0, NULL); /* error */ |
| 558 | 558 | else { |
| 559 | lua_pushnumber(L, (lua_Number)l_ftell(f)); | |
| 559 | lua_pushnumber(L, (lua_Number)(1.0 * l_ftell(f))); | |
| 560 | 560 | return 1; |
| 561 | 561 | } |
| 562 | 562 | } |
| r242836 | r242837 | |
|---|---|---|
| 104 | 104 | |
| 105 | 105 | static lua_Number readhexa (const char **s, lua_Number r, int *count) { |
| 106 | 106 | for (; lisxdigit(cast_uchar(**s)); (*s)++) { /* read integer part */ |
| 107 | r = (r * cast_num(16.0)) + cast_num(luaO_hexavalue(cast_uchar(**s))); | |
| 107 | r = (r * cast_num(16.0)) + cast_num(1.0*luaO_hexavalue(cast_uchar(**s))); | |
| 108 | 108 | (*count)++; |
| 109 | 109 | } |
| 110 | 110 | return r; |
| r242836 | r242837 | |
|---|---|---|
| 120 | 120 | |
| 121 | 121 | |
| 122 | 122 | static int os_clock (lua_State *L) { |
| 123 | lua_pushnumber(L, ((lua_Number)clock())/(lua_Number)CLOCKS_PER_SEC); | |
| 123 | lua_pushnumber(L, ((lua_Number)(1.0*clock()))/(lua_Number)CLOCKS_PER_SEC); | |
| 124 | 124 | return 1; |
| 125 | 125 | } |
| 126 | 126 | |
| r242836 | r242837 | |
| 194 | 194 | |
| 195 | 195 | static int os_date (lua_State *L) { |
| 196 | 196 | const char *s = luaL_optstring(L, 1, "%c"); |
| 197 | time_t t = luaL_opt(L, | |
| 197 | time_t t = luaL_opt(L, luaL_checknumber, 2, time(NULL)); | |
| 198 | 198 | struct tm tmr, *stm; |
| 199 | 199 | if (*s == '!') { /* UTC? */ |
| 200 | 200 | stm = l_gmtime(&t, &tmr); |
| r242836 | r242837 | |
| 264 | 264 | |
| 265 | 265 | |
| 266 | 266 | static int os_difftime (lua_State *L) { |
| 267 | lua_pushnumber(L, difftime((time_t)(luaL_checknumber(L, 1)), | |
| 268 | (time_t)(luaL_optnumber(L, 2, 0)))); | |
| 267 | lua_pushnumber(L, difftime((luaL_checknumber(L, 1)), | |
| 268 | (luaL_optnumber(L, 2, 0)))); | |
| 269 | 269 | return 1; |
| 270 | 270 | } |
| 271 | 271 |
| r242836 | r242837 | |
|---|---|---|
| 339 | 339 | Table *h = hvalue(rb); |
| 340 | 340 | tm = fasttm(L, h->metatable, TM_LEN); |
| 341 | 341 | if (tm) break; /* metamethod? break switch to call it */ |
| 342 | setnvalue(ra, cast_num(luaH_getn(h))); /* else primitive len */ | |
| 342 | setnvalue(ra, cast_num(1.0*luaH_getn(h))); /* else primitive len */ | |
| 343 | 343 | return; |
| 344 | 344 | } |
| 345 | 345 | case LUA_TSTRING: { |
| r242836 | r242837 | |
|---|---|---|
| 643 | 643 | -I$(SRC)/lib/util \ |
| 644 | 644 | -I$(SRC)/lib \ |
| 645 | 645 | -I$(3RDPARTY) \ |
| 646 | -I$(3RDPARTY)/lua/src \ | |
| 646 | 647 | -I$(SRC)/osd \ |
| 647 | 648 | -I$(SRC)/osd/$(OSD) \ |
| 648 | 649 |
| r242836 | r242837 | |
|---|---|---|
| 9 | 9 | ***************************************************************************/ |
| 10 | 10 | |
| 11 | 11 | #include <limits> |
| 12 | #include "lua | |
| 12 | #include "lua.hpp" | |
| 13 | 13 | #include "luabridge/Source/LuaBridge/LuaBridge.h" |
| 14 | 14 | #include <signal.h> |
| 15 | 15 | #include "emu.h" |
| r242836 | r242837 | |
|---|---|---|
| 24 | 24 | #undef None |
| 25 | 25 | #endif |
| 26 | 26 | |
| 27 | #include "lua | |
| 27 | #include "lua.hpp" | |
| 28 | 28 | #include "luabridge/Source/LuaBridge/LuaBridge.h" |
| 29 | 29 | |
| 30 | 30 | struct lua_State; |
| https://github.com/mamedev/mame/commit/022e6c7a5bf7a2046a0540022c5aab999d7d7cf4 |
| Previous | 199869 Revisions | Next |