inline void type_assert(lua_State* L, int index, type expected) { type actual = type_of(L, index); type_assert(L, index, expected, actual); }
void ffi_set_address(OBJECT ptr, void *addr) { type_assert(ptr, MemPtrType, "passing a pointer"); *DATA_STRUCT(ptr, void**) = addr; }
thread(lua_State* L, int index = -1) : reference(L, index) { #ifdef SOL_CHECK_ARGUMENTS type_assert(L, index, type::thread); #endif // Safety }
void ffi_autorelease(OBJECT ptr, int ar) { type_assert(ptr, MemPtrType, "passing a pointer"); ptr->RequiresCleanup = (ar ? 1 : 0); }