FreeBSD Bugzilla – Attachment 242287 Details for
Bug 271520
graphics/sdl_image: fix build with clang 16
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
graphics/sdl_image: fix build with clang 16
graphics__sdl_image-fix-clang16-build-1.diff (text/plain), 7.73 KB, created by
Dimitry Andric
on 2023-05-19 20:16:35 UTC
(
hide
)
Description:
graphics/sdl_image: fix build with clang 16
Filename:
MIME Type:
Creator:
Dimitry Andric
Created:
2023-05-19 20:16:35 UTC
Size:
7.73 KB
patch
obsolete
>commit 8c343dc7f5ed85778199b75d2719951cba5ebbe3 >Author: Dimitry Andric <dim@FreeBSD.org> >Date: 2023-05-19 22:12:08 +0200 > > graphics/sdl_image: fix build with clang 16 > > Clang 16 has a new error about incompatible function types, which shows > up when building graphics/sdl_image: > > IMG_png.c:266:30: error: incompatible function pointer types assigning to 'png_infop (*)(png_structp)' (aka 'struct png_info_def *(*)(struct png_struct_def *)') from 'png_infop (png_const_structrp)' (aka 'struct png_info_def *(const struct png_struct_def *restrict)') [-Wincompatible-function-pointer-types] > lib.png_create_info_struct = png_create_info_struct; > ^ ~~~~~~~~~~~~~~~~~~~~~~ > IMG_png.c:269:20: error: incompatible function pointer types assigning to 'png_uint_32 (*)(png_structp, png_infop, png_uint_32 *, png_uint_32 *, int *, int *, int *, int *, int *)' (aka 'unsigned int (*)(struct png_struct_def *, struct png_info_def *, unsigned int *, unsigned int *, int *, int *, int *, int *, int *)') from 'png_uint_32 (png_const_structrp, png_const_inforp, png_uint_32 *, png_uint_32 *, int *, int *, int *, int *, int *)' (aka 'unsigned int (const struct png_struct_def *restrict, const struct png_info_def *restrict, unsigned int *, unsigned int *, int *, int *, int *, int *, int *)') [-Wincompatible-function-pointer-types] > lib.png_get_IHDR = png_get_IHDR; > ^ ~~~~~~~~~~~~ > > Similar errors occur for IMG_webp.c. I backported a few changes from > SDL_image 2 that fix the prototypes to be compatible with the versions > of graphics/png and and graphics/webp. > >diff --git a/graphics/sdl_image/files/patch-IMG__png.c b/graphics/sdl_image/files/patch-IMG__png.c >new file mode 100644 >index 000000000000..2646ebd70ec7 >--- /dev/null >+++ b/graphics/sdl_image/files/patch-IMG__png.c >@@ -0,0 +1,82 @@ >+--- IMG_png.c.orig 2012-01-21 01:51:33 UTC >++++ IMG_png.c >+@@ -71,33 +71,61 @@ >+ #include <png.h> >+ >+ /* Check for the older version of libpng */ >+-#if (PNG_LIBPNG_VER_MAJOR == 1) && (PNG_LIBPNG_VER_MINOR < 4) >++#if (PNG_LIBPNG_VER_MAJOR == 1) >++#if (PNG_LIBPNG_VER_MINOR < 5) >+ #define LIBPNG_VERSION_12 >++typedef png_bytep png_const_bytep; >++typedef png_color *png_const_colorp; >++typedef png_color_16 *png_const_color_16p; >+ #endif >++#if (PNG_LIBPNG_VER_MINOR < 4) >++typedef png_structp png_const_structp; >++typedef png_infop png_const_infop; >++#endif >++#if (PNG_LIBPNG_VER_MINOR < 6) >++typedef png_structp png_structrp; >++typedef png_infop png_inforp; >++typedef png_const_structp png_const_structrp; >++typedef png_const_infop png_const_inforp; >++/* noconst15: version < 1.6 doesn't have const, >= 1.6 adds it */ >++/* noconst16: version < 1.6 does have const, >= 1.6 removes it */ >++typedef png_structp png_noconst15_structrp; >++typedef png_inforp png_noconst15_inforp; >++typedef png_const_inforp png_noconst16_inforp; >++#else >++typedef png_const_structp png_noconst15_structrp; >++typedef png_const_inforp png_noconst15_inforp; >++typedef png_inforp png_noconst16_inforp; >++#endif >++#else >++typedef png_const_structp png_noconst15_structrp; >++typedef png_const_inforp png_noconst15_inforp; >++typedef png_inforp png_noconst16_inforp; >++#endif >+ >+ static struct { >+ int loaded; >+ void *handle; >+- png_infop (*png_create_info_struct) (png_structp png_ptr); >++ png_infop (*png_create_info_struct) (png_noconst15_structrp png_ptr); >+ png_structp (*png_create_read_struct) (png_const_charp user_png_ver, png_voidp error_ptr, png_error_ptr error_fn, png_error_ptr warn_fn); >+ void (*png_destroy_read_struct) (png_structpp png_ptr_ptr, png_infopp info_ptr_ptr, png_infopp end_info_ptr_ptr); >+- png_uint_32 (*png_get_IHDR) (png_structp png_ptr, png_infop info_ptr, png_uint_32 *width, png_uint_32 *height, int *bit_depth, int *color_type, int *interlace_method, int *compression_method, int *filter_method); >+- png_voidp (*png_get_io_ptr) (png_structp png_ptr); >+- png_byte (*png_get_channels) (png_structp png_ptr, png_infop info_ptr); >+- png_uint_32 (*png_get_PLTE) (png_structp png_ptr, png_infop info_ptr, png_colorp *palette, int *num_palette); >+- png_uint_32 (*png_get_tRNS) (png_structp png_ptr, png_infop info_ptr, png_bytep *trans, int *num_trans, png_color_16p *trans_values); >+- png_uint_32 (*png_get_valid) (png_structp png_ptr, png_infop info_ptr, png_uint_32 flag); >+- void (*png_read_image) (png_structp png_ptr, png_bytepp image); >+- void (*png_read_info) (png_structp png_ptr, png_infop info_ptr); >+- void (*png_read_update_info) (png_structp png_ptr, png_infop info_ptr); >+- void (*png_set_expand) (png_structp png_ptr); >+- void (*png_set_gray_to_rgb) (png_structp png_ptr); >+- void (*png_set_packing) (png_structp png_ptr); >+- void (*png_set_read_fn) (png_structp png_ptr, png_voidp io_ptr, png_rw_ptr read_data_fn); >+- void (*png_set_strip_16) (png_structp png_ptr); >+- int (*png_sig_cmp) (png_bytep sig, png_size_t start, png_size_t num_to_check); >++ png_uint_32 (*png_get_IHDR) (png_noconst15_structrp png_ptr, png_noconst15_inforp info_ptr, png_uint_32 *width, png_uint_32 *height, int *bit_depth, int *color_type, int *interlace_method, int *compression_method, int *filter_method); >++ png_voidp (*png_get_io_ptr) (png_noconst15_structrp png_ptr); >++ png_byte (*png_get_channels) (png_const_structrp png_ptr, png_const_inforp info_ptr); >++ png_uint_32 (*png_get_PLTE) (png_const_structrp png_ptr, png_noconst16_inforp info_ptr, png_colorp *palette, int *num_palette); >++ png_uint_32 (*png_get_tRNS) (png_const_structrp png_ptr, png_inforp info_ptr, png_bytep *trans, int *num_trans, png_color_16p *trans_values); >++ png_uint_32 (*png_get_valid) (png_const_structrp png_ptr, png_const_inforp info_ptr, png_uint_32 flag); >++ void (*png_read_image) (png_structrp png_ptr, png_bytepp image); >++ void (*png_read_info) (png_structrp png_ptr, png_inforp info_ptr); >++ void (*png_read_update_info) (png_structrp png_ptr, png_inforp info_ptr); >++ void (*png_set_expand) (png_structrp png_ptr); >++ void (*png_set_gray_to_rgb) (png_structrp png_ptr); >++ void (*png_set_packing) (png_structrp png_ptr); >++ void (*png_set_read_fn) (png_structrp png_ptr, png_voidp io_ptr, png_rw_ptr read_data_fn); >++ void (*png_set_strip_16) (png_structrp png_ptr); >++ int (*png_sig_cmp) (png_const_bytep sig, png_size_t start, png_size_t num_to_check); >+ #ifndef LIBPNG_VERSION_12 >+- jmp_buf* (*png_set_longjmp_fn) (png_structp, png_longjmp_ptr, size_t); >++ jmp_buf* (*png_set_longjmp_fn) (png_structrp, png_longjmp_ptr, size_t); >+ #endif >+ } lib; >+ >diff --git a/graphics/sdl_image/files/patch-IMG__webp.c b/graphics/sdl_image/files/patch-IMG__webp.c >new file mode 100644 >index 000000000000..5e506a0929f2 >--- /dev/null >+++ b/graphics/sdl_image/files/patch-IMG__webp.c >@@ -0,0 +1,15 @@ >+--- IMG_webp.c.orig 2012-01-21 01:51:33 UTC >++++ IMG_webp.c >+@@ -47,9 +47,9 @@ static struct { >+ static struct { >+ int loaded; >+ void *handle; >+- int/*VP8StatuCode*/ (*webp_get_features_internal) (const uint8_t *data, uint32_t data_size, WebPBitstreamFeatures* const features, int decoder_abi_version); >+- uint8_t* (*webp_decode_rgb_into) (const uint8_t* data, uint32_t data_size, uint8_t* output_buffer, int output_buffer_size, int output_stride); >+- uint8_t* (*webp_decode_rgba_into) (const uint8_t* data, uint32_t data_size, uint8_t* output_buffer, int output_buffer_size, int output_stride); >++ VP8StatusCode (*webp_get_features_internal) (const uint8_t *data, size_t data_size, WebPBitstreamFeatures* features, int decoder_abi_version); >++ uint8_t* (*webp_decode_rgb_into) (const uint8_t* data, size_t data_size, uint8_t* output_buffer, size_t output_buffer_size, int output_stride); >++ uint8_t* (*webp_decode_rgba_into) (const uint8_t* data, size_t data_size, uint8_t* output_buffer, size_t output_buffer_size, int output_stride); >+ } lib; >+ >+ #ifdef LOAD_WEBP_DYNAMIC
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 271520
: 242287