Changeset 406 for trunk/src/lib/lua.cc
- Timestamp:
- 06/20/15 00:05:17 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/lua.cc
r395 r406 128 128 static const lua_Number *lua_version_51 (lua_State*) 129 129 { 130 static const lua_Number version = (lua_Number)LUA_VERSION_NUM;130 static const lua_Number version = lua_Number( LUA_VERSION_NUM ); 131 131 return &version; 132 132 } … … 227 227 #endif 228 228 229 # define NV_LUA_FUN( rtype, fname, fparams ) *(void **) (&fname) = lua_library.get(#fname);229 # define NV_LUA_FUN( rtype, fname, fparams ) void_assign( fname, lua_library.get(#fname) ); 230 230 # if NV_LUA_VERSION == NV_LUA_52 231 231 # define NV_LUA_FUN_51( rtype, fname, fparams ) … … 246 246 247 247 #if NV_LUA_VERSION == NV_LUA_5C 248 # define NV_LUA_LOAD( fname ) *(void **) (&fname) = lua_library.get(#fname);249 # define NV_LUA_LOAD_AS( fname,fname2 ) *(void **) (&fname) = lua_library.get(#fname2);248 # define NV_LUA_LOAD( fname ) void_assign( fname, lua_library.get(#fname) ); 249 # define NV_LUA_LOAD_AS( fname,fname2 ) void_assign( fname, lua_library.get(#fname2) ); 250 250 bool version_52 = lua_library.try_get("luaL_checkversion_") != nullptr; 251 251 if (version_52) 252 252 { 253 253 # define NV_LUA_COMPAT_FUN( u1, fn, u2, u3, fn2, u5, u6, u7 ) \ 254 *(void **) (&(fn2##_compat)) = lua_library.get(#fn2); \254 void_assign( fn2##_compat, lua_library.get(#fn2) ); \ 255 255 fn = call_##fn2##_compat; 256 256 # include <nv/lib/detail/lua_functions_compat.inc> … … 280 280 { 281 281 # define NV_LUA_COMPAT_FUN( u1, fn, u2, u3, u4, u5, u6, u7 ) \ 282 *(void **) (&fn) = lua_library.get(#fn);282 void_assign(fn, lua_library.get(#fn) ); 283 283 # include <nv/lib/detail/lua_functions_compat.inc> 284 284 # undef NV_LUA_COMPAT_FUN
Note: See TracChangeset
for help on using the changeset viewer.