1 https://github.com/glennrp/libpng/commit/12e63e91af1378225993b36e25ce3252b54e751a.patch
3 From 12e63e91af1378225993b36e25ce3252b54e751a Mon Sep 17 00:00:00 2001
4 From: Dagobert Michelsen <dam@opencsw.org>
5 Date: Mon, 14 Mar 2016 16:21:06 +0100
6 Subject: [PATCH] Force back to C89 if needed. This fixes #245
9 configure.ac | 14 ++++++++++++++
10 1 file changed, 14 insertions(+)
12 diff --git a/configure.ac b/configure.ac
13 index 3b8746a..ee3ea05 100644
16 @@ -114,6 +114,20 @@ AC_ARG_ENABLE(werror,
20 +# For GCC 5 the default mode for C is -std=gnu11 instead of -std=gnu89
21 +# In pngpriv.h we request just the POSIX 1003.1 and C89 APIs by defining _POSIX_SOURCE to 1
22 +# This is incompatible with the new default mode, so we test for that and force the
23 +AC_MSG_CHECKING([if we need to force back C standard to C89])
24 +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#define _POSIX_SOURCE 1
26 +])],AC_MSG_RESULT(no),[
27 +if test "x$GCC" != "xyes"; then
28 + AC_MSG_ERROR([Forcing back to C89 is required but the flags are unknown for other compilers than GCC])
31 +CFLAGS="$CFLAGS -std=c89"
34 # Checks for header files.