From af76ad5e4b2535e41949245ee2c2d621b981e1f7 Mon Sep 17 00:00:00 2001 From: jca Date: Sun, 4 Jul 2021 14:55:34 +0000 Subject: [PATCH] Fix conflict with uncompress2() provided by recent zlib releases ok tb@ --- emulators/libretro-pcsx-rearmed/Makefile | 3 ++- .../patches/patch-libpcsxcore_cdriso_c | 25 +++++++++++++++++++ .../patches/patch-plugins_cdrcimg_cdrcimg_c | 25 +++++++++++++++++++ 3 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 emulators/libretro-pcsx-rearmed/patches/patch-libpcsxcore_cdriso_c create mode 100644 emulators/libretro-pcsx-rearmed/patches/patch-plugins_cdrcimg_cdrcimg_c diff --git a/emulators/libretro-pcsx-rearmed/Makefile b/emulators/libretro-pcsx-rearmed/Makefile index 9844006c034..7e46a67de0c 100644 --- a/emulators/libretro-pcsx-rearmed/Makefile +++ b/emulators/libretro-pcsx-rearmed/Makefile @@ -1,9 +1,10 @@ -# $OpenBSD: Makefile,v 1.2 2019/07/12 20:46:09 sthen Exp $ +# $OpenBSD: Makefile,v 1.3 2021/07/04 14:55:34 jca Exp $ COMMENT = Sony PlayStation core for retroarch V = 22 DISTNAME = libretro-pcsx-rearmed-$V +REVISION = 0 GH_ACCOUNT = notaz GH_PROJECT = pcsx_rearmed diff --git a/emulators/libretro-pcsx-rearmed/patches/patch-libpcsxcore_cdriso_c b/emulators/libretro-pcsx-rearmed/patches/patch-libpcsxcore_cdriso_c new file mode 100644 index 00000000000..e5ff3065901 --- /dev/null +++ b/emulators/libretro-pcsx-rearmed/patches/patch-libpcsxcore_cdriso_c @@ -0,0 +1,25 @@ +$OpenBSD: patch-libpcsxcore_cdriso_c,v 1.1 2021/07/04 14:55:34 jca Exp $ + +Fix conflict with uncompress2() provided by recent zlib releases. + +Index: libpcsxcore/cdriso.c +--- libpcsxcore/cdriso.c.orig ++++ libpcsxcore/cdriso.c +@@ -1082,7 +1082,7 @@ static int cdread_sub_mixed(FILE *f, unsigned int base + return ret; + } + +-static int uncompress2(void *out, unsigned long *out_size, void *in, unsigned long in_size) ++static int my_uncompress2(void *out, unsigned long *out_size, void *in, unsigned long in_size) + { + static z_stream z; + int ret = 0; +@@ -1161,7 +1161,7 @@ static int cdread_compressed(FILE *f, unsigned int bas + if (is_compressed) { + cdbuffer_size_expect = sizeof(compr_img->buff_raw[0]) << compr_img->block_shift; + cdbuffer_size = cdbuffer_size_expect; +- ret = uncompress2(compr_img->buff_raw[0], &cdbuffer_size, compr_img->buff_compressed, size); ++ ret = my_uncompress2(compr_img->buff_raw[0], &cdbuffer_size, compr_img->buff_compressed, size); + if (ret != 0) { + SysPrintf("uncompress failed with %d for block %d, sector %d\n", + ret, block, sector); diff --git a/emulators/libretro-pcsx-rearmed/patches/patch-plugins_cdrcimg_cdrcimg_c b/emulators/libretro-pcsx-rearmed/patches/patch-plugins_cdrcimg_cdrcimg_c new file mode 100644 index 00000000000..b684c21a0f1 --- /dev/null +++ b/emulators/libretro-pcsx-rearmed/patches/patch-plugins_cdrcimg_cdrcimg_c @@ -0,0 +1,25 @@ +$OpenBSD: patch-plugins_cdrcimg_cdrcimg_c,v 1.1 2021/07/04 14:55:34 jca Exp $ + +Fix conflict with uncompress2() provided by recent zlib releases. + +Index: plugins/cdrcimg/cdrcimg.c +--- plugins/cdrcimg/cdrcimg.c.orig ++++ plugins/cdrcimg/cdrcimg.c +@@ -98,7 +98,7 @@ static long CDRgetTD(unsigned char track, unsigned cha + return 0; + } + +-int uncompress2(void *out, unsigned long *out_size, void *in, unsigned long in_size) ++int my_uncompress2(void *out, unsigned long *out_size, void *in, unsigned long in_size) + { + static z_stream z; + int ret = 0; +@@ -199,7 +199,7 @@ static long CDRreadTrack(unsigned char *time) + ret = uncompress(cdbuffer->raw[0], &cdbuffer_size, cdbuffer->compressed, size); + break; + case CDRC_ZLIB2: +- ret = uncompress2(cdbuffer->raw[0], &cdbuffer_size, cdbuffer->compressed, size); ++ ret = my_uncompress2(cdbuffer->raw[0], &cdbuffer_size, cdbuffer->compressed, size); + break; + case CDRC_BZ: + ret = pBZ2_bzBuffToBuffDecompress((char *)cdbuffer->raw, (unsigned int *)&cdbuffer_size,