Fix crash when used in Blender.

When OpenNURBS is used through rhino3dm in Blender there is
a crash in Blender in its openvdb library due to the same named
symbol inflate_fast.

Rename the one we have in our zlib library to zinflate_fast to
prevent the crash from happening.
This commit is contained in:
Nathan Letwory
2024-07-10 10:46:32 +03:00
parent a14564cf09
commit 5fcd089d99
4 changed files with 22 additions and 22 deletions

View File

@@ -7,7 +7,7 @@
This code is largely copied from inflate.c. Normally either infback.o or
inflate.o would be linked into an application--not both. The interface
with inffast.c is retained so that optimized assembler-coded versions of
inflate_fast() can be used with either inflate.c or infback.c.
zinflate_fast() can be used with either inflate.c or infback.c.
*/
#include "zutil.h"
@@ -115,7 +115,7 @@ struct inflate_state FAR *state;
/* Macros for inflateBack(): */
/* Load returned state from inflate_fast() */
/* Load returned state from zinflate_fast() */
#define LOAD() \
do { \
put = strm->next_out; \
@@ -126,7 +126,7 @@ struct inflate_state FAR *state;
bits = state->bits; \
} while (0)
/* Set state from registers for inflate_fast() */
/* Set state from registers for zinflate_fast() */
#define RESTORE() \
do { \
strm->next_out = put; \
@@ -462,12 +462,12 @@ void FAR *out_desc;
state->mode = LEN;
case LEN:
/* use inflate_fast() if we have enough input and output */
/* use zinflate_fast() if we have enough input and output */
if (have >= 6 && left >= 258) {
RESTORE();
if (state->whave < state->wsize)
state->whave = state->wsize - left;
inflate_fast(strm, state->wsize);
zinflate_fast(strm, state->wsize);
LOAD();
break;
}