summaryrefslogtreecommitdiff
path: root/include/xatonum.h
diff options
context:
space:
mode:
authorDenis Vlasenko2006-11-25 14:49:04 +0000
committerDenis Vlasenko2006-11-25 14:49:04 +0000
commit43bddf31e95080abf7232952da9064207636f47b (patch)
treebcd498d7eb67a83b49f55d881fedc8ff05d89fb5 /include/xatonum.h
parentf2408e6c3ff5f9f798bb5553346d9e1657dc9833 (diff)
downloadbusybox-43bddf31e95080abf7232952da9064207636f47b.zip
busybox-43bddf31e95080abf7232952da9064207636f47b.tar.gz
small improvements in str -> num convertors
Diffstat (limited to 'include/xatonum.h')
-rw-r--r--include/xatonum.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/xatonum.h b/include/xatonum.h
index cdb5e73..46e49b0 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();
+}