From 17a2e7f574db97672577270cef7f7f2cccab60aa Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Wed, 15 Mar 2017 01:58:41 +0300 Subject: [PATCH] Fix GC_SIZE_MAX definition (Linux/musl-gcc) (Cherry-pick commit f40fab8 from 'release-7_6' branch.) * include/private/gc_priv.h [SIZE_MAX] (GC_SIZE_MAX): Cast SIZE_MAX to size_t explicitly (to workaround incorrect definition of SIZE_MAX - e.g. it is defined as ~0ULL in musl-tools which is not correct for a 32-bit target). --- include/private/gc_priv.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/private/gc_priv.h b/include/private/gc_priv.h index 38403379..38eba595 100644 --- a/include/private/gc_priv.h +++ b/include/private/gc_priv.h @@ -94,7 +94,8 @@ typedef char * ptr_t; /* A generic pointer to which we can add */ # include #endif #ifdef SIZE_MAX -# define GC_SIZE_MAX SIZE_MAX +# define GC_SIZE_MAX ((size_t)SIZE_MAX) + /* Extra cast to workaround some buggy SIZE_MAX definitions. */ #else # define GC_SIZE_MAX (~(size_t)0) #endif -- 2.40.0