Skip to content

Commit

Permalink
Fix build when CFLAGS contains -std=c89 (or -ansi)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
dcommander committed Dec 5, 2016
1 parent 786b649 commit fcfc6c5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions jconfigint.h.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
/* libjpeg-turbo build number */
#undef BUILD

/* Compiler's inline keyword */
#undef inline

/* How to obtain function inlining. */
#undef INLINE

Expand Down

0 comments on commit fcfc6c5

Please sign in to comment.