I'm (cross-)compiling for a handheld (GPH WIZ) and it doesn't have a FPU, so i need do disable that:
configure CPPFLAGS="-I/opt/cc/open2x/include -DPNG_NO_FLOATING_ARITHMETIC"
I get the following error:
contrib/libtests/pngvalid.c: In function 'main':
contrib/libtests/pngvalid.c:10058: error: 'FE_DIVBYZERO' undeclared (first use in this function)
[...]
The toolchain's header files don't define those macros in fenc.h as the device doesn't have a FPU.
In the mentioned file (contrib/libtests/pngvalid.c) i see:
so i commented that out MANUALLY in config.h as configure doesn't let me disable it.
After that it's compiling successfully.
a) Shouldn't that be disabled anyway if PNG_NO_FLOATING_ARITHMETIC is defined...?
(I'm not sure if that makes sense...)
b) OR it should be possible to disable FEENABLEEXCEPT with configure at first (i guess thats a feature request then)
Please try libpng-1.6.14beta03 which is currently available at the head of the libpng16 branch of the libpng GIT repository and as tar distributions in the usual places.
Last edit: Glenn Randers-Pehrson 2014-09-19
Yep, it's compiling now, thx :-)
In libpng-1.6.14beta03 we have defined FE_DIVBYZERO, etc., if they have not already been defined in the included fenv.h. We did not disable floating point arithmetic in pngvalid.c, even if the user has defined PNG_NO_FLOATING_ARITHMETIC_SUPPORTED (libpng itself would not use floating arithmetic under this circumstance, but pngvalid will, if the platform provides it). See recent discussion (Sept 2014) on the png-mng-implement mailing list.
Fixed in libpng-1.6.14