From 43bddf31e95080abf7232952da9064207636f47b Mon Sep 17 00:00:00 2001 From: Denis Vlasenko Date: Sat, 25 Nov 2006 14:49:04 +0000 Subject: small improvements in str -> num convertors --- include/xatonum.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'include/xatonum.h') diff --git a/include/xatonum.h b/include/xatonum.h index cdb5e7393..46e49b0eb 100644 --- a/include/xatonum.h +++ b/include/xatonum.h @@ -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(); +} -- cgit v1.2.3