Only use exit(77) in configure builds

Signed-off-by: John Bowler <jbowler@acm.org>
This commit is contained in:
John Bowler
2016-01-26 17:55:39 -08:00
parent e0ce90ea0a
commit ac796d3f9a
5 changed files with 47 additions and 10 deletions

View File

@@ -36,6 +36,15 @@
# include <setjmp.h> /* because png.h did *not* include this */
#endif
/* 1.6.1 added support for the configure test harness, which uses 77 to indicate
* a skipped test, in earlier versions we need to succeed on a skipped test, so:
*/
#if PNG_LIBPNG_VER >= 10601 && defined(HAVE_CONFIG_H)
# define SKIP 77
#else
# define SKIP 0
#endif
#if defined(PNG_INFO_IMAGE_SUPPORTED) && defined(PNG_SEQUENTIAL_READ_SUPPORTED)\
&& (defined(PNG_READ_PNG_SUPPORTED) || PNG_LIBPNG_VER < 10700)
/* If a transform is valid on both read and write this implies that if the
@@ -1682,6 +1691,6 @@ int
main(void)
{
fprintf(stderr, "pngimage: no support for png_read/write_image\n");
return 77;
return SKIP;
}
#endif