lua-users home
lua-l archive

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


>> I recently compiled Lua 5 with the Hitachi EC++ compiler for SH4 and I had
>> to make some changes. They led to the following questions and suggestions.
> Could you please send those changes to the Lua team directly so that we can
> see what can be incoporated in the base code and make it yet more portable?
I'll do so when I'm thru with our project (deadline was a week ago :( ).

>> 1. In liolib.c, you use CLOCKS_PER_SEC. Shouldn't it be CLK_TCK?
> No. that's all that ANSI C provides.
> See http://www.opengroup.org/onlinepubs/007904975/functions/clock.html
Hmm .. I'll have a look at it.
However, is it ok to have some checks if the compiler supports CLOCKS_PER_SEC  
or CLK_TCK instead? Something like

#ifdef CLOCKS_PER_SEC
const static int clocks_per_sec = CLOCKS_PER_SEC;
#else
const static int clocks_per_sec = CLK_TCK;
#endif

or will it cause problems with other compilers? Maybe I've to change the  
header files provided with the Hitachi SH4 compiler.

>> 1. For the next Lua version, can you save the compiled Lua script in a
>> machine-independent way?
> It has been so since the introduction of luac in Lua 2.4.
> See http://lua-users.org/lists/lua-l/2003-05/msg00357.html
Sorry, but I didn't recognize that during my first tests. I'll send more  
information when we have a working sample.

Best regards,
Mark Junker