diff --git a/internal/lauxlib.go b/internal/lauxlib.go index 3dc27da..3a16a85 100644 --- a/internal/lauxlib.go +++ b/internal/lauxlib.go @@ -2,7 +2,7 @@ package internal /* #cgo CFLAGS: -Iluau/VM/include -I/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/include -#cgo LDFLAGS: -L${SRCDIR}/luau/cmake -lLuau.VM +#cgo LDFLAGS: -L${SRCDIR}/luau/cmake -lLuau.VM -lm -lstdc++ #include #include #include diff --git a/internal/lua.go b/internal/lua.go index 5ecf2be..a8e97bd 100644 --- a/internal/lua.go +++ b/internal/lua.go @@ -2,7 +2,7 @@ package internal /* #cgo CFLAGS: -Iluau/VM/include -I/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/include -#cgo LDFLAGS: -L${SRCDIR}/luau/cmake -lLuau.VM +#cgo LDFLAGS: -L${SRCDIR}/luau/cmake -lLuau.VM -lm -lstdc++ #include #include #include @@ -269,8 +269,5 @@ func PushInteger(L *C.lua_State, n lua_Integer) { } // TODO: Vector 3 & 4 -func PushVector(L *C.lua_State, x float32, y float32, z float32) { - C.lua_pushvector(L, C.float(x), C.float(y), C.float(z)) -} // TODO: Rest of it diff --git a/internal/vector3.go b/internal/vector3.go new file mode 100644 index 0000000..5deeb36 --- /dev/null +++ b/internal/vector3.go @@ -0,0 +1,14 @@ +//go:build !LUAU_VECTOR4 + +package internal + +/* +#cgo CFLAGS: -Iluau/VM/include -I/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/include +#cgo LDFLAGS: -L${SRCDIR}/luau/cmake -lLuau.VM -lm -lstdc++ +#include +*/ +import "C" + +func PushVector(L *C.lua_State, x float32, y float32, z float32) { + C.lua_pushvector(L, C.float(x), C.float(y), C.float(z)) +} diff --git a/internal/vector4.go b/internal/vector4.go new file mode 100644 index 0000000..ac9a0ff --- /dev/null +++ b/internal/vector4.go @@ -0,0 +1,14 @@ +//go:build LUAU_VECTOR4 + +package internal + +/* +#cgo CFLAGS: -Iluau/VM/include -I/usr/lib/gcc/x86_64-pc-linux-gnu/14.1.1/include +#cgo LDFLAGS: -L${SRCDIR}/luau/cmake -lLuau.VM -lm -lstdc++ +#include +*/ +import "C" + +func PushVector(L *C.lua_State, x float32, y float32, z float32, w float32) { + C.lua_pushvector(L, C.float(x), C.float(y), C.float(z), C.float(w)) +}