diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/libbb.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/libbb.h b/include/libbb.h index aff2825ac..daccf154a 100644 --- a/include/libbb.h +++ b/include/libbb.h @@ -162,6 +162,17 @@ #ifndef HAVE_XTABS # define XTABS TAB3 #endif +/* + * Use '%m' to append error string on platforms that support it, + * '%s' and strerror() on those that don't. + */ +#ifdef HAVE_PRINTF_PERCENTM +# define STRERROR_FMT "%m" +# define STRERROR_ERRNO /*nothing*/ +#else +# define STRERROR_FMT "%s" +# define STRERROR_ERRNO ,strerror(errno) +#endif /* Some libc's forget to declare these, do it ourself */ |