diff options
Diffstat (limited to 'src/compat.cpp')
-rw-r--r-- | src/compat.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/compat.cpp b/src/compat.cpp index 19159a9..47fe37e 100644 --- a/src/compat.cpp +++ b/src/compat.cpp | |||
@@ -51,8 +51,10 @@ void* lua_newuserdatauv( lua_State* L, size_t sz, int nuvalue) | |||
51 | return lua_newuserdata( L, sz); | 51 | return lua_newuserdata( L, sz); |
52 | } | 52 | } |
53 | 53 | ||
54 | int lua_getiuservalue( lua_State* L, int idx, int n) | 54 | // push on stack uservalue #n of full userdata at idx |
55 | int lua_getiuservalue(lua_State* L, int idx, int n) | ||
55 | { | 56 | { |
57 | // full userdata can have only 1 uservalue before 5.4 | ||
56 | if( n > 1) | 58 | if( n > 1) |
57 | { | 59 | { |
58 | lua_pushnil( L); | 60 | lua_pushnil( L); |
@@ -76,6 +78,7 @@ int lua_getiuservalue( lua_State* L, int idx, int n) | |||
76 | return lua_type( L, -1); | 78 | return lua_type( L, -1); |
77 | } | 79 | } |
78 | 80 | ||
81 | // pop stack top, sets it a uservalue #n of full userdata at idx | ||
79 | int lua_setiuservalue( lua_State* L, int idx, int n) | 82 | int lua_setiuservalue( lua_State* L, int idx, int n) |
80 | { | 83 | { |
81 | if( n > 1 | 84 | if( n > 1 |