strnlen is a GNU extension --- libpng/pngerror.c +++ libpng/pngerror.c @@ -23,6 +23,16 @@ png_default_warning PNGARG((png_structp png_ptr, png_const_charp warning_message)); +#ifndef _GNU_SOURCE +size_t strnlen(const char *s, size_t limit) +{ + size_t len = 0; + while ((len < limit) && (*s++)) + len++; + return len; +} +#endif + /* This function is called whenever there is a fatal error. This function * should not be changed. If there is a need to handle errors differently, * you should supply a replacement error function and use png_set_error_fn()