/* TEST ONLY: creates scalar lightuserdata inside an isolated LuaJIT VM.
   Never linked into the mod or loaded into the game. Does not dereference it. */
#include <stdint.h>
typedef struct lua_State lua_State;
typedef int (*lua_CFunction)(lua_State *);
extern double lua_tonumber(lua_State *, int);
extern void lua_pushlightuserdata(lua_State *, void *);
extern void lua_pushcclosure(lua_State *, lua_CFunction, int);
static int make_value(lua_State *L) {
    uintptr_t value = (uintptr_t)lua_tonumber(L, 1);
    lua_pushlightuserdata(L, (void *)value);
    return 1;
}
int luaopen_lightfixture(lua_State *L) {
    lua_pushcclosure(L, make_value, 0);
    return 1;
}
