From: Ivan Maidanski Date: Tue, 14 Mar 2017 22:58:41 +0000 (+0300) Subject: Fix GC_SIZE_MAX definition (Linux/musl-gcc) X-Git-Tag: v7.4.6~138 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=17a2e7f574db97672577270cef7f7f2cccab60aa;p=gc 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). --- 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