small improvements in str -> num convertors

This commit is contained in:
Denis Vlasenko
2006-11-25 14:49:04 +00:00
parent f2408e6c3f
commit 43bddf31e9
3 changed files with 25 additions and 9 deletions

View File

@@ -92,3 +92,15 @@ DEFINE_EQUIV_STR_CONV(int, i, l, u, ul)
#else
DECLARE_STR_CONV(int, i, u)
#endif
/* Specialized */
int BUG_xatou32_unimplemented(void);
extern inline uint32_t xatou32(const char *numstr)
{
if (UINT_MAX == 0xffffffff)
return xatou(numstr);
if (ULONG_MAX == 0xffffffff)
return xatoul(numstr);
return BUG_xatou32_unimplemented();
}