[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re[2]: parse hex numerals [PATCH]
- From: cloudwu <cloudwu@...>
- Date: Thu, 9 Feb 2006 22:17:12 +0800
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
[君子有容人之量, 小人存忌妒之心]