From fcfc6c5eed40ee35964bbb52d4e090ec163538e5 Mon Sep 17 00:00:00 2001 From: DRC Date: Mon, 5 Dec 2016 14:02:59 -0600 Subject: [PATCH] Fix build when CFLAGS contains -std=c89 (or -ansi) This is a subtle point, but AC_C_INLINE defines "inline" to be either "inline", "__inline__", or "__inline". The subsequent test for "inline __attribute__((always_inline))" uses this definition. The attribute is irrespective of the inline keyword, so whereas "__inline__ __attribute__((always_inline))" works under C89, "inline __attribute__((always_inline))" doesn't, and defining INLINE to the latter causes the build to fail. The easiest way around this is simply to define "inline" ahead of "INLINE" in jconfigint.h, which causes the inline keyword detected by AC_C_INLINE to modify the INLINE macro if necessary. --- jconfigint.h.in | 3 +++ 1 file changed, 3 insertions(+) diff --git a/jconfigint.h.in b/jconfigint.h.in index 940424ea2..963e76020 100644 --- a/jconfigint.h.in +++ b/jconfigint.h.in @@ -1,6 +1,9 @@ /* libjpeg-turbo build number */ #undef BUILD +/* Compiler's inline keyword */ +#undef inline + /* How to obtain function inlining. */ #undef INLINE