lvandeve / lodepng

PNG encoder and decoder in C and C++.
zlib License
2.11k stars 426 forks source link

Fix breakage with -DLODEPNG_NO_COMPILE_CRC #161

Open hpjansson opened 2 years ago

hpjansson commented 2 years ago

Compiling with -DLODEPNG_NO_COMPILE_CRC would lead to linker errors, since lodepng_crc32() was still being referenced:

liblodepng.a(lodepng.o): in function lodepng_chunk_check_crc: lodepng.cpp:2496: undefined reference to lodepng_crc32 liblodepng.a(lodepng.o): in function lodepng_chunk_generate_crc: lodepng.cpp:2503: undefined reference to lodepng_crc32 liblodepng.a(lodepng.o): in function lodepng_inspect: lodepng.cpp:4083: undefined reference to lodepng_crc32

Just #ifdef out the references too, ignoring CRCs in the decoder and generating a zero CRC in the encoder.