lua-users home
lua-l archive

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


Hello Roberto,

Thursday, February 9, 2006, 8:18:04 PM, you wrote:


>> for an explanation and a (IMHO) better/simpler patch which makes
>> hex numbers work with non-C99 libraries, too (MSVC for Windows).

RI> Do we really need a patch? Can't we just use configuration? Something
RI> like this (untested...):

RI>   #define lua_str2number(s,p)  \
RI>      (s[0]=='0' && s[1] == 'x') ? strtoul(s[2], p, 16) : strtod((s), (p))

RI> -- Roberto

it works (tested :)

#define lua_str2number(s,p) \
        ((s[0]=='0' && s[1] == 'x') ? strtoul(s+2, p, 16) : strtod((s), (p)))

-- 
Best regards,
 cloudwu                            mailto:cloudwu@163.com
            http://blog.codingnow.com

[君子有容人之量, 小人存忌妒之心]