Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ MUSHclient ➜ Lua ➜ 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 page


Posted by Nick Gammon   Australia  (23,158 posts)  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
Top

Posted by Nick Gammon   Australia  (23,158 posts)  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
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.


8,305 views.

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

Go to topic:           Search the forum


[Go to top] top

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