From f32def466bb9365b7a9956e24782bc13936ac42e Mon Sep 17 00:00:00 2001 From: Kris Katterjohn Date: Sun, 29 Jul 2018 19:58:37 -0500 Subject: [PATCH] Avoid undefined C macro behavior A C macro expanding to a `defined' has undefined behavior. The clang compiler was issuing warnings. --- AUTHORS | 1 + include/chibi/features.h | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/AUTHORS b/AUTHORS index f6098064..15ca501d 100644 --- a/AUTHORS +++ b/AUTHORS @@ -46,6 +46,7 @@ Thanks to the following people for patches and bug reports: * Jeronimo Pellegrini * John Cowan * John Samsa + * Kris Katterjohn * Lars J Aas * Lorenzo Campedelli * Marc Nieper-Wißkirchen diff --git a/include/chibi/features.h b/include/chibi/features.h index 9c28aeba..c280fe84 100644 --- a/include/chibi/features.h +++ b/include/chibi/features.h @@ -304,7 +304,11 @@ /* for bignum support, need a double long to store long*long */ /* gcc supports uint128_t, otherwise we need a custom struct */ #ifndef SEXP_USE_CUSTOM_LONG_LONGS -#define SEXP_USE_CUSTOM_LONG_LONGS (SEXP_64_BIT && !defined(__GNUC__)) +#if SEXP_64_BIT && !defined(__GNUC__) +#define SEXP_USE_CUSTOM_LONG_LONGS 1 +#else +#define SEXP_USE_CUSTOM_LONG_LONGS 0 +#endif #endif #ifndef SEXP_USE_NO_FEATURES