lua-users home
lua-l archive

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


On 2/9/06, Roberto Ierusalimschy <roberto@inf.puc-rio.br> wrote:
> > for an explanation and a (IMHO) better/simpler patch which makes
> > hex numbers work with non-C99 libraries, too (MSVC for Windows).
>
> Do we really need a patch? Can't we just use configuration? Something
> like this (untested...):
>
>   #define lua_str2number(s,p)  \
>      (s[0]=='0' && s[1] == 'x') ? strtoul(s[2], p, 16) : strtod((s), (p))
>
> -- Roberto
>

Actually I did not knew but 5.1 does hex numerals already so that
patch is useless.

Not being familiar with lua's codebase, I expected it to be in llex.c
and as it wasn't there I just added it there.

I'm stiil trying to figure out when and where the recognition of the
hex numeral is made.

Luis.

--
This information is top security. When you have read it, destroy yourself.
-- Marshall McLuhan