From 7b989fb6bca6c14ba9638ea364a858e16a139ec0 Mon Sep 17 00:00:00 2001 From: Stephen Heumann Date: Tue, 2 Dec 2014 18:57:45 -0600 Subject: [PATCH] Work around a preprocessor bug that was causing an inappropriate version of many of the xatonum functions to be included in every object file. --- include/xatonum.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/include/xatonum.h b/include/xatonum.h index 11b301d6d..4d33bbdf2 100644 --- a/include/xatonum.h +++ b/include/xatonum.h @@ -81,8 +81,14 @@ narrow xato##N(const char *str) \ DECLARE_STR_CONV(long, l, ul) +/* Without the explicit !defined(__ORCAC__) check, ORCA/C's preprocessor was + * falsely treating the following #if as true. I think this occurs because + * the preprocessor state is somehow corrupted. The added check seems to work + * around the bug; hopefully the corruption doesn't cause any other problems. + */ + /* Same for int -> [long] long */ -#if UINT_MAX == ULONG_MAX +#if !defined(__ORCAC__) && UINT_MAX == ULONG_MAX DEFINE_EQUIV_STR_CONV(int, i, l, u, ul) #else DECLARE_STR_CONV(int, i, u) @@ -107,7 +113,7 @@ DECLARE_STR_CONV(int, i, u) unsigned long bb_strtoul(const char *arg, char **endp, int base) FAST_FUNC; long bb_strtol(const char *arg, char **endp, int base) FAST_FUNC; -#if UINT_MAX == ULONG_MAX +#if !defined(__ORCAC__) && UINT_MAX == ULONG_MAX static ALWAYS_INLINE unsigned bb_strtou(const char *arg, char **endp, int base) { return bb_strtoul(arg, endp, base); }