From dce241c107e8a4e3192129a816e253c75dc3d1b9 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Thu, 30 Mar 2017 00:12:53 +0000 Subject: [PATCH 1/2] silence clang -Wcast-qual const drop warnings --- pngpriv.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pngpriv.h b/pngpriv.h index 6d2e424d2..2369b8e29 100644 --- a/pngpriv.h +++ b/pngpriv.h @@ -466,7 +466,14 @@ static_cast(static_cast(value)) #else # define png_voidcast(type, value) (value) -# define png_constcast(type, value) ((type)(value)) +# if defined( _WIN64 ) && ! defined( __GNUC__ ) + typedef unsigned __int64 png_ptruint; +# elif defined( _WIN64 ) + typedef unsigned long long png_ptruint; +# else + typedef unsigned long png_ptruint; +# endif +# define png_constcast(type, value) ((type)(png_ptruint)(const void*)(value)) # define png_aligncast(type, value) ((void*)(value)) # define png_aligncastconst(type, value) ((const void*)(value)) #endif /* __cplusplus */ From 7bbd665b34b0ad5074fc0dd44cf20838baeeafa3 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Thu, 30 Mar 2017 12:22:25 +0000 Subject: [PATCH 2/2] tweak --- pngpriv.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pngpriv.h b/pngpriv.h index 2369b8e29..0b13740b0 100644 --- a/pngpriv.h +++ b/pngpriv.h @@ -466,10 +466,12 @@ static_cast(static_cast(value)) #else # define png_voidcast(type, value) (value) -# if defined( _WIN64 ) && ! defined( __GNUC__ ) - typedef unsigned __int64 png_ptruint; -# elif defined( _WIN64 ) - typedef unsigned long long png_ptruint; +# ifdef _WIN64 +# ifdef __GNUC__ + typedef unsigned long long png_ptruint; +# else + typedef unsigned __int64 png_ptruint; +# endif # else typedef unsigned long png_ptruint; # endif