gsl-shell.git - gsl-shell

index : gsl-shell.git
gsl-shell
summary refs log tree commit diff
path: root/agg-plot/lua-cpp-utils.h
diff options
context:
space:
mode:
Diffstat (limited to 'agg-plot/lua-cpp-utils.h')
-rw-r--r--agg-plot/lua-cpp-utils.h 20
1 files changed, 20 insertions, 0 deletions
diff --git a/agg-plot/lua-cpp-utils.h b/agg-plot/lua-cpp-utils.h
new file mode 100644
index 00000000..df0c97bd
--- /dev/null
+++ b/agg-plot/lua-cpp-utils.h
@@ -0,0 +1,20 @@
+#ifndef LUA_CPP_UTILS_H
+#define LUA_CPP_UTILS_H
+
+#include <new>
+
+#include "defs.h"
+__BEGIN_DECLS
+#include "lua.h"
+__END_DECLS
+
+#include "gs-types.h"
+
+inline void* operator new(size_t nbytes, lua_State *L, enum gs_type_e tp)
+{
+ void* p = lua_newuserdata(L, nbytes);
+ gs_set_metatable (L, tp);
+ return p;
+}
+
+#endif
generated by cgit v1.2.3 (git 2.39.1) at 2025年09月13日 19:55:08 +0000

AltStyle によって変換されたページ (->オリジナル) /