aboutsummaryrefslogtreecommitdiff
path: root/include/libbb.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/libbb.h')
-rw-r--r--include/libbb.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/libbb.h b/include/libbb.h
index 015374b4a..c2e034447 100644
--- a/include/libbb.h
+++ b/include/libbb.h
@@ -150,6 +150,7 @@ int sysinfo(struct sysinfo* info);
150/* CONFIG_LFS is on */ 150/* CONFIG_LFS is on */
151# if ULONG_MAX > 0xffffffff 151# if ULONG_MAX > 0xffffffff
152/* "long" is long enough on this system */ 152/* "long" is long enough on this system */
153typedef unsigned long uoff_t;
153# define XATOOFF(a) xatoul_range(a, 0, LONG_MAX) 154# define XATOOFF(a) xatoul_range(a, 0, LONG_MAX)
154/* usage: sz = BB_STRTOOFF(s, NULL, 10); if (errno || sz < 0) die(); */ 155/* usage: sz = BB_STRTOOFF(s, NULL, 10); if (errno || sz < 0) die(); */
155# define BB_STRTOOFF bb_strtoul 156# define BB_STRTOOFF bb_strtoul
@@ -158,6 +159,7 @@ int sysinfo(struct sysinfo* info);
158# define OFF_FMT "l" 159# define OFF_FMT "l"
159# else 160# else
160/* "long" is too short, need "long long" */ 161/* "long" is too short, need "long long" */
162typedef unsigned long long uoff_t;
161# define XATOOFF(a) xatoull_range(a, 0, LLONG_MAX) 163# define XATOOFF(a) xatoull_range(a, 0, LLONG_MAX)
162# define BB_STRTOOFF bb_strtoull 164# define BB_STRTOOFF bb_strtoull
163# define STRTOOFF strtoull 165# define STRTOOFF strtoull
@@ -168,11 +170,13 @@ int sysinfo(struct sysinfo* info);
168# if UINT_MAX == 0xffffffff 170# if UINT_MAX == 0xffffffff
169/* While sizeof(off_t) == sizeof(int), off_t is typedef'ed to long anyway. 171/* While sizeof(off_t) == sizeof(int), off_t is typedef'ed to long anyway.
170 * gcc will throw warnings on printf("%d", off_t). Crap... */ 172 * gcc will throw warnings on printf("%d", off_t). Crap... */
173typedef unsigned long uoff_t;
171# define XATOOFF(a) xatoi_u(a) 174# define XATOOFF(a) xatoi_u(a)
172# define BB_STRTOOFF bb_strtou 175# define BB_STRTOOFF bb_strtou
173# define STRTOOFF strtol 176# define STRTOOFF strtol
174# define OFF_FMT "l" 177# define OFF_FMT "l"
175# else 178# else
179typedef unsigned long uoff_t;
176# define XATOOFF(a) xatoul_range(a, 0, LONG_MAX) 180# define XATOOFF(a) xatoul_range(a, 0, LONG_MAX)
177# define BB_STRTOOFF bb_strtoul 181# define BB_STRTOOFF bb_strtoul
178# define STRTOOFF strtol 182# define STRTOOFF strtol