[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: mathlib
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Tue, 8 Apr 2014 14:46:34 -0300
> Anyway, the first portability fix would be to make the same code compile
> against Lua 5.1 and 5.2 like a lot of other modules:
>
> LUALIB_API int luaopen_mathx(lua_State *L)
> {
> #if LUA_VERSION_NUM <= 501
> luaL_register(L,LUA_MATHLIBNAME,R);
> #else
> lua_getglobal(L,LUA_MATHLIBNAME);
> luaL_setfuncs(L,R,0);
> #endif
Have you checked lmathx for 5.1? It does that already:
http://www.tecgraf.puc-rio.br/~lhf/ftp/lua/5.1/lmathx.tar.gz
> For Visual Studio 2010 and 2012, the following warnings and errors are
> generated. I don't know what you would do to fix them.
If these compilers support C99 math functions then there is probably
a switch somewhere. Note how I've used
#define _GNU_SOURCE 1
so that it works in Linux, which is probably not optimal but worked on
the systems I tested.
- References:
- Re: mathlib, Ousmane Roland Yonaba
- Re: mathlib, Roberto Ierusalimschy
- Re: mathlib, Ralph Hempel
- Re: mathlib, Roberto Ierusalimschy
- Re: mathlib, Enrico Colombini
- Re: mathlib, Rena
- Re: mathlib, Michel Martens
- Re: mathlib, Dirk Laurie
- Re: mathlib, Luiz Henrique de Figueiredo
- Re: mathlib, Joshua Jensen