summaryrefslogtreecommitdiff
path: root/src/00-misc/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/00-misc/main.cpp')
-rw-r--r--src/00-misc/main.cpp37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/00-misc/main.cpp b/src/00-misc/main.cpp
index d55dac8..ce137b2 100644
--- a/src/00-misc/main.cpp
+++ b/src/00-misc/main.cpp
@@ -10,8 +10,28 @@ extern "C" {
#include <windows.h>
#include <time.h>
#include <conio.h>
+#include <iostream>
+
+using namespace std;
+
+static int __gc(lua_State* L)
+{
+ return 0;
+}
+
+static int l_createObj(lua_State* L)
+{
+ int* u = (int*)lua_newuserdata(L, sizeof(int));
+ lua_newtable(L);
+ lua_pushstring(L, "__gc");
+ lua_pushcfunction(L, __gc);
+ lua_rawset(L, -3);
+ lua_setmetatable(L, -2);
+ return 1;
+}
luaL_reg fns[] = {
+ {"createObj", l_createObj},
{ 0, 0 }
};
@@ -28,6 +48,23 @@ void openlibs(lua_State* L)
}
}
+class MyClass
+{
+public :
+ virtual void Foo() {};
+
+};
+
+
+class MyClass2 : public MyClass
+{
+public:
+
+ virtual void Foo() {};
+
+};
+
+
int main(int args, char* argv[])
{
lua_State* L = luaL_newstate();