[Home] [Downloads] [Search] [Help/forum]


Register forum user name Search FAQ

Gammon Forum

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  Lua
. . -> [Subject]  Differences between "standard" Lua and the one in MUSHclient

Differences between "standard" Lua and the one in MUSHclient

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page


Posted by Nick Gammon   Australia  (22,975 posts)  [Biography] bio   Forum Administrator
Date Fri 13 Apr 2007 01:55 AM (UTC)

Amended on Fri 13 Apr 2007 02:02 AM (UTC) by Nick Gammon

Message
For the record, this is a "diff" of the Lua DLL supplied with MUSHclient, compared to the standard distribution from www.lua.org:


diff lua-5.1.1/src/Makefile lua-5.1.1.nick/src/Makefile
11c11
< CFLAGS= -O2 -Wall $(MYCFLAGS)
---
> CFLAGS= -O3 -Wall $(MYCFLAGS)
103c103
< 	$(MAKE) "LUA_A=lua51.dll" "LUA_T=lua.exe" \
---
> 	$(MAKE) "LUA_A=lua5.1.dll" "LUA_T=lua.exe" \
diff lua-5.1.1/src/luaconf.h lua-5.1.1.nick/src/luaconf.h
336c336
< #define LUA_COMPAT_VARARG
---
> #undef LUA_COMPAT_VARARG
343c343
< #define LUA_COMPAT_MOD
---
> #undef LUA_COMPAT_MOD
351c351
< #define LUA_COMPAT_LSTR		1
---
> #undef LUA_COMPAT_LSTR
358c358
< #define LUA_COMPAT_GFIND
---
> #undef LUA_COMPAT_GFIND
366a367
> //#undef LUA_COMPAT_OPENLIB
737a739,740
> #define  LUA_USELONGLONG // njg
> 
740c743
< #define LUA_INTFRMLEN		"ll"
---
> #define LUA_INTFRMLEN		"I64"
742a746,748
> //#define LUA_INTFRMLEN		"I64"     // njg
> //#define LUA_INTFRM_T		__int64     // njg
> 


Basically the changes are:


  • Cranked optimization up from O2 (Optimize even more) to O3 (Optimize yet more).

  • Changed the DLL name to lua5.1.dll (rather than lua51.dll).

  • Turn off some compatability options: LUA_COMPAT_VARARG, LUA_COMPAT_MOD, LUA_COMPAT_LSTR, LUA_COMPAT_GFIND and LUA_COMPAT_OPENLIB. The comments in the file luaconf.h suggest turning those off as soon as possible, so I have done that.

  • Turn on the option LUA_USELONGLONG, and use the appropriate format specifiers, in order to better support conversion from floating point to integers.


It is also worth pointing out that to make the DLL (under Cygwin) I had to use this command line:


make "CC=gcc -mno-cygwin" mingw


If you don't specify "-mno-cygwin" then it builds a dependency on cygwin.dll, which adds an extra DLL to ship, and extra space.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Nick Gammon   Australia  (22,975 posts)  [Biography] bio   Forum Administrator
Date Reply #1 on Fri 13 Apr 2007 02:05 AM (UTC)
Message
If you choose to compile it under MS Visual Studio 6, you have to change the "long long" type to __int64, which is why that is there, commented out.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


7,322 views.

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at HostDash]