diff --git a/include/haproxy/compat.h b/include/haproxy/compat.h index 886b7a365..84cdbe0d5 100644 --- a/include/haproxy/compat.h +++ b/include/haproxy/compat.h @@ -85,6 +85,16 @@ typedef struct { } empty_t; #define BITS_PER_INT (8*sizeof(int)) #endif +#ifndef __WORDSIZE +# if defined(__SIZEOF_LONG__) && __SIZEOF_LONG__ == 4 +# define __WORDSIZE 32 +# elif defined(__SIZEOF_LONG__) && __SIZEOF_LONG__ == 8 +# define __WORDSIZE 64 +# else +# error "Unknown machine word size (__WORDSIZE, __SIZEOF_LONG)" +# endif +#endif + #ifndef MIN #define MIN(a, b) (((a) < (b)) ? (a) : (b)) #endif