lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Hi,
 
I have tried to compile Lua 5.2.2 on Windows. Generally, everything goes smoothly. With exception of one problem - the current source base does not permit to 'luac' to use 'lua522.dll' because some symbols are not exported in DLL. I addressed this problem locally at http://github.com/serge1/vslua. The change consists of three lines declaration modification.
 
For your convenience, I am providing the patch below.
 
Do you think that the problem addressed correctly? Would it be possible to apply (this, or another) fix for upcoming Lua releases?
 
Thank you,
Serge



From 641f57322da3f43e6d48287614ff073fb1c6c13c Mon Sep 17 00:00:00 2001
From: Serge Lamikhov-Center <to_serge=at=users.sourceforge.net>
Date: Tue, 4 Jun 2013 14:41:35 +0300
Subject: [PATCH] Modify Lua sources to compile as a Windows DLL

"luac" compilation is not possible without these changes
---
 lua-5.2.2/src/ldump.c   | 2 +-
 lua-5.2.2/src/luaconf.h | 2 +-
 lua-5.2.2/src/lundump.h | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/lua-5.2.2/src/ldump.c b/lua-5.2.2/src/ldump.c
index d5e6a47..ab6de9c 100644
--- a/lua-5.2.2/src/ldump.c
+++ b/lua-5.2.2/src/ldump.c
@@ -159,7 +159,7 @@ static void DumpHeader(DumpState* D)
 /*
 ** dump Lua function as precompiled chunk
 */
-int luaU_dump (lua_State* L, const Proto* f, lua_Writer w, void* data, int strip)
+LUA_API int luaU_dump (lua_State* L, const Proto* f, lua_Writer w, void* data, int strip)
 {
  DumpState D;
  D.L=L;
diff --git a/lua-5.2.2/src/luaconf.h b/lua-5.2.2/src/luaconf.h
index df802c9..003cb32 100644
--- a/lua-5.2.2/src/luaconf.h
+++ b/lua-5.2.2/src/luaconf.h
@@ -182,7 +182,7 @@
 
 #else				/* }{ */
 #define LUAI_FUNC	extern
-#define LUAI_DDEC	extern
+#define LUAI_DDEC	LUA_API
 #define LUAI_DDEF	/* empty */
 #endif				/* } */
 
diff --git a/lua-5.2.2/src/lundump.h b/lua-5.2.2/src/lundump.h
index 2b8acce..0fd43bb 100644
--- a/lua-5.2.2/src/lundump.h
+++ b/lua-5.2.2/src/lundump.h
@@ -17,7 +17,7 @@ LUAI_FUNC Closure* luaU_undump (lua_State* L, ZIO* Z, Mbuffer* buff, const char*
 LUAI_FUNC void luaU_header (lu_byte* h);
 
 /* dump one chunk; from ldump.c */
-LUAI_FUNC int luaU_dump (lua_State* L, const Proto* f, lua_Writer w, void* data, int strip);
+LUA_API int luaU_dump (lua_State* L, const Proto* f, lua_Writer w, void* data, int strip);
 
 /* data to catch conversion errors */
 #define LUAC_TAIL		"\x19\x93\r\n\x1a\n"
-- 
1.8.1.msysgit.1