From 97bd312eab176e3c736150c91fa400e3f4fbb43b Mon Sep 17 00:00:00 2001 From: Nathan Letwory Date: Sun, 22 Feb 2026 11:22:55 +0200 Subject: [PATCH] Rename z_inflate to jk_z_inflate. On Linux the z_inflate symbol gets looked up in openvdb SO. This causes crashes. Renaming the symbol works around the problem. --- freetype263/src/gzip/infcodes.c | 2 +- freetype263/src/gzip/zconf.h | 2 +- opennurbs_compress.cpp | 4 ++-- opennurbs_zlib.cpp | 4 ++-- zlib/infback.c | 2 +- zlib/inffast.c | 2 +- zlib/inffast.h | 2 +- zlib/inflate.c | 2 +- zlib/zconf.h | 2 +- 9 files changed, 11 insertions(+), 11 deletions(-) diff --git a/freetype263/src/gzip/infcodes.c b/freetype263/src/gzip/infcodes.c index f7bfd58c..6aa346d9 100644 --- a/freetype263/src/gzip/infcodes.c +++ b/freetype263/src/gzip/infcodes.c @@ -105,7 +105,7 @@ int r ) if (m >= 258 && n >= 10) { UPDATE - r = inflate_fast(c->lbits, c->dbits, c->ltree, c->dtree, s, z); + r = jk_inflate_fast(c->lbits, c->dbits, c->ltree, c->dtree, s, z); LOAD if (r != Z_OK) { diff --git a/freetype263/src/gzip/zconf.h b/freetype263/src/gzip/zconf.h index 68f7f283..4f59af11 100644 --- a/freetype263/src/gzip/zconf.h +++ b/freetype263/src/gzip/zconf.h @@ -17,7 +17,7 @@ # define deflate z_deflate # define deflateEnd z_deflateEnd # define inflateInit_ z_inflateInit_ -# define inflate z_inflate +# define inflate jk_z_inflate # define inflateEnd z_inflateEnd # define deflateInit2_ z_deflateInit2_ # define deflateSetDictionary z_deflateSetDictionary diff --git a/opennurbs_compress.cpp b/opennurbs_compress.cpp index ff67ac50..018617ce 100644 --- a/opennurbs_compress.cpp +++ b/opennurbs_compress.cpp @@ -470,7 +470,7 @@ bool ON_UncompressStream::In( ON__UINT64 size, const void* compressed_buffer ) // calculate compression ON__UINT32 avail_in0 = strm.avail_in; ON__UINT32 avail_out0 = strm.avail_out; - zrc = z_inflate( &strm, Z_NO_FLUSH ); + zrc = jk_z_inflate( &strm, Z_NO_FLUSH ); if ( zrc < 0 ) { // Something went haywire - bail out. @@ -557,7 +557,7 @@ bool ON_UncompressStream::End() strm.avail_out = sizeof_out_buffer; // finish compression calculation - zrc = z_inflate( &strm, Z_FINISH ); + zrc = jk_z_inflate( &strm, Z_FINISH ); if ( zrc < 0 ) { // Something went haywire - bail out. diff --git a/opennurbs_zlib.cpp b/opennurbs_zlib.cpp index cbe93598..2692d21f 100644 --- a/opennurbs_zlib.cpp +++ b/opennurbs_zlib.cpp @@ -527,7 +527,7 @@ bool ON_BinaryArchive::ReadInflate( // no compressed input is left - switch to finish mode flush = Z_FINISH; } - zrc = z_inflate( &m_zlib.m_strm, flush ); + zrc = jk_z_inflate( &m_zlib.m_strm, flush ); if ( zrc < 0 ) { // Something went haywire - bail out. @@ -1341,7 +1341,7 @@ bool ON_CompressedBuffer::InflateHelper( // no compressed input is left - switch to finish mode flush = Z_FINISH; } - zrc = z_inflate( &m_zlib.m_strm, flush ); + zrc = jk_z_inflate( &m_zlib.m_strm, flush ); if ( zrc < 0 ) { // Something went haywire - bail out. diff --git a/zlib/infback.c b/zlib/infback.c index 950173fc..5664f7a3 100644 --- a/zlib/infback.c +++ b/zlib/infback.c @@ -467,7 +467,7 @@ void FAR *out_desc; RESTORE(); if (state->whave < state->wsize) state->whave = state->wsize - left; - inflate_fast(strm, state->wsize); + jk_inflate_fast(strm, state->wsize); LOAD(); break; } diff --git a/zlib/inffast.c b/zlib/inffast.c index dc344240..dd7afa3e 100644 --- a/zlib/inffast.c +++ b/zlib/inffast.c @@ -64,7 +64,7 @@ requires strm->avail_out >= 258 for each loop to avoid checking for output space. */ -void inflate_fast(strm, start) +void jk_inflate_fast(strm, start) z_streamp strm; unsigned start; /* inflate()'s starting value for strm->avail_out */ { diff --git a/zlib/inffast.h b/zlib/inffast.h index 1e88d2d9..0321bf60 100644 --- a/zlib/inffast.h +++ b/zlib/inffast.h @@ -8,4 +8,4 @@ subject to change. Applications should only use zlib.h. */ -void inflate_fast OF((z_streamp strm, unsigned start)); +void jk_inflate_fast OF((z_streamp strm, unsigned start)); diff --git a/zlib/inflate.c b/zlib/inflate.c index 70739644..4d74286d 100644 --- a/zlib/inflate.c +++ b/zlib/inflate.c @@ -950,7 +950,7 @@ int flush; case LEN: if (have >= 6 && left >= 258) { RESTORE(); - inflate_fast(strm, out); + jk_inflate_fast(strm, out); LOAD(); break; } diff --git a/zlib/zconf.h b/zlib/zconf.h index 046ce2ab..6c3ebc40 100644 --- a/zlib/zconf.h +++ b/zlib/zconf.h @@ -57,7 +57,7 @@ warning C4127: conditional expression is constant # define deflate z_deflate # define deflateEnd z_deflateEnd # define inflateInit_ z_inflateInit_ -# define inflate z_inflate +# define inflate jk_z_inflate # define inflateEnd z_inflateEnd # define deflateInit2_ z_deflateInit2_ # define deflateSetDictionary z_deflateSetDictionary