summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/plugin-luasmtp.cc28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/plugin-luasmtp.cc b/src/plugin-luasmtp.cc
new file mode 100644
index 0000000..4c62060
--- /dev/null
+++ b/src/plugin-luasmtp.cc
@@ -0,0 +1,28 @@
+#include <LuaSmtp.h>
+
+#ifndef WIN32
+#define WEAK __attribute__ ((weak))
+#else
+#define WEAK
+#endif
+
+static void _init_plugin(Lua * L) {
+ static bool done = false;
+ if (done) return;
+ done = true;
+ LuaLuaMailHandler::pushstatics(L);
+}
+
+extern "C" {
+
+#ifndef NO_DLL
+WEAK void init_plugin(Lua * L) {
+ _init_plugin(L);
+}
+#endif
+
+void luasmtp_init(Lua * L) {
+ _init_plugin(L);
+}
+
+}