diff --git a/src/alloc.c b/src/alloc.c index 3bc9277a7b..201e3f0b13 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -3336,10 +3336,14 @@ sweep_vectors (void) } } -static ptrdiff_t const VECTOR_ELTS_MAX - = min (((min (PTRDIFF_MAX, SIZE_MAX) - header_size - large_vector_offset) - / word_size), - MOST_POSITIVE_FIXNUM); +/* Maximum number of elements in a vector. This is a macro so that it + can be used in an integer constant expression. */ + +#define VECTOR_ELTS_MAX \ + ((ptrdiff_t) \ + min (((min (PTRDIFF_MAX, SIZE_MAX) - header_size - large_vector_offset) \ + / word_size), \ + MOST_POSITIVE_FIXNUM)) /* Value is a pointer to a newly allocated Lisp_Vector structure with room for LEN Lisp_Objects. LEN must be positive and