summaryrefslogtreecommitdiff
path: root/include/xatonum.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/xatonum.h')
-rw-r--r--include/xatonum.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/xatonum.h b/include/xatonum.h
index 6f76a3c..45ebbfc 100644
--- a/include/xatonum.h
+++ b/include/xatonum.h
@@ -168,6 +168,15 @@ uint32_t bb_strtou32(const char *arg, char **endp, int base)
return bb_strtoul(arg, endp, base);
return BUG_bb_strtou32_unimplemented();
}
+static ALWAYS_INLINE
+int32_t bb_strtoi32(const char *arg, char **endp, int base)
+{
+ if (sizeof(int32_t) == sizeof(int))
+ return bb_strtoi(arg, endp, base);
+ if (sizeof(int32_t) == sizeof(long))
+ return bb_strtol(arg, endp, base);
+ return BUG_bb_strtou32_unimplemented();
+}
/* Floating point */