From b279feb7c580dabfa6014e41060b1d22fd119712 Mon Sep 17 00:00:00 2001 From: pcpa Date: Mon, 9 Sep 2013 19:19:45 -0300 Subject: [PATCH] Add fallback logic instead of error if cannot figure __WORDSIZE. This was an issue on FreeBSD 8.x, and the logic used is the same as FreeBSD 9.1 stdint.h. --- include/lightning.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/include/lightning.h b/include/lightning.h index 5fdbc292b..87de1d1ad 100644 --- a/include/lightning.h +++ b/include/lightning.h @@ -48,8 +48,13 @@ # else # define __WORDSIZE 64 # endif -# else -# error cannot figure __WORDSIZE +# else /* From FreeBSD 9.1 stdint.h */ +# if defined(UINTPTR_MAX) && defined(UINT64_MAX) && \ + (UINTPTR_MAX == UINT64_MAX) +# define __WORDSIZE 64 +# else +# define __WORDSIZE 32 +# endif # endif #endif #ifndef __LITTLE_ENDIAN