fix: prevent zlib Byte typedef clash with project class Byte under clang

This commit is contained in:
JuiceyDev 2026-03-06 08:31:58 +01:00
parent 379d7d9ee5
commit 57ed1aab14

View file

@ -1,7 +1,13 @@
#include "../../Build/stdafx.h"
#include "Compression.h"
#if defined __ORBIS__ || defined __PS3__ || defined _DURANGO || defined _WIN64 || defined __linux__
// zconf.h defines "typedef unsigned char Byte" which conflicts with the
// project's "class Byte" from BasicTypeContainers.h (via stdafx.h).
// Rename zlib's Byte to zlib_Byte before the include so the typedef lands
// under that alias; Bytef (= Byte FAR) will resolve to zlib_Byte as well.
#define Byte zlib_Byte
#include <zlib.h>
#undef Byte
#endif
#if defined __PSVITA__