From b3481b470b6590bbb7e59911e79c39532c268739 Mon Sep 17 00:00:00 2001 From: Jan Kotas Date: Mon, 19 Aug 2024 20:41:39 -0700 Subject: [PATCH] Delete workaround for classic zlib (#106659) --- .../libs/System.IO.Compression.Native/CMakeLists.txt | 4 ---- .../System.IO.Compression.Native/zlib_allocator_unix.c | 9 ++------- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/src/native/libs/System.IO.Compression.Native/CMakeLists.txt b/src/native/libs/System.IO.Compression.Native/CMakeLists.txt index 69d333ae53f9c..ee3ce54e4a5f2 100644 --- a/src/native/libs/System.IO.Compression.Native/CMakeLists.txt +++ b/src/native/libs/System.IO.Compression.Native/CMakeLists.txt @@ -46,10 +46,6 @@ if (CLR_CMAKE_TARGET_UNIX OR CLR_CMAKE_TARGET_BROWSER OR CLR_CMAKE_TARGET_WASI) # Disable implicit fallthrough warning for Zlib and Brotli set(FLAGS -Wno-implicit-fallthrough) - # Disable no strict prototypes warning for Zlib - # https://github.com/madler/zlib/issues/633 - set(FLAGS "${FLAGS} -Wno-strict-prototypes") - # Delete this suppression once brotli is upgraded to vNext (current latest v1.0.9 # does not contain upstream fix: https://github.com/google/brotli/commit/0a3944c) if (NOT CLR_CMAKE_TARGET_WASI) diff --git a/src/native/libs/System.IO.Compression.Native/zlib_allocator_unix.c b/src/native/libs/System.IO.Compression.Native/zlib_allocator_unix.c index b2c898f70a4e3..38638d6158526 100644 --- a/src/native/libs/System.IO.Compression.Native/zlib_allocator_unix.c +++ b/src/native/libs/System.IO.Compression.Native/zlib_allocator_unix.c @@ -73,10 +73,7 @@ static void WriteAllocCookieUnaligned(void* pDest, DOTNET_ALLOC_COOKIE vCookie) const size_t DOTNET_ALLOC_HEADER_COOKIE_SIZE_WITH_PADDING = (sizeof(DOTNET_ALLOC_COOKIE) + MEMORY_ALLOCATION_ALIGNMENT - 1) & ~((size_t)MEMORY_ALLOCATION_ALIGNMENT - 1); const size_t DOTNET_ALLOC_TRAILER_COOKIE_SIZE = sizeof(DOTNET_ALLOC_COOKIE); -voidpf z_custom_calloc(opaque, items, size) - voidpf opaque; - unsigned items; - unsigned size; +voidpf z_custom_calloc(voidpf opaque, unsigned items, unsigned size) { (void)opaque; // unreferenced formal parameter @@ -122,9 +119,7 @@ static void zcfree_trash_cookie(void* pCookie) memset(pCookie, 0, sizeof(DOTNET_ALLOC_COOKIE)); } -void z_custom_cfree(opaque, ptr) - voidpf opaque; - voidpf ptr; +void z_custom_cfree(voidpf opaque, voidpf ptr) { (void)opaque; // unreferenced formal parameter