1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-02-02 03:20:06 +00:00

Don't try to use nonexistent libpng optimizations

The embedded copy of libpng doesn't contain code for processor-specific
hardware optimizations, but it may still try to use them in some cases,
resulting in linker errors.

juce_PNGLoader.cpp already sets `PNG_ARM_NEON_OPT` to 0 to disable
optimizations on ARM, but this should be done for all architectures,
especially PowerPC, where builds currently fail.

On x86, this isn't strictly necessary, because libpng optimizations are
opt-in for x86, rather than opt-out as with all other architectures, but
for completeness and robustness it is also included here.

The macros to disable optimizations on other platforms come straight
from libpng's own build files; this is how it disables optimizations
when compiled without support for them. `PNG_ARM_NEON_OPT` is already
one of those macros; this commit simply adds the other three.
This commit is contained in:
taylor.fish 2024-01-26 17:22:15 -08:00
parent 6c32c4df87
commit e18a62fdf2

View file

@ -266,6 +266,9 @@ namespace pnglibNamespace
#define PNG_LINKAGE_FUNCTION
#define PNG_ARM_NEON_OPT 0
#define PNG_POWERPC_VSX_OPT 0
#define PNG_INTEL_SSE_OPT 0
#define PNG_MIPS_MSA_OPT 0
#if ! defined (PNG_USER_WIDTH_MAX)
#define PNG_USER_WIDTH_MAX 1000000