aboutsummaryrefslogtreecommitdiff
path: root/include/xatonum.h
diff options
context:
space:
mode:
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 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();
+}