From dbc482418ad5b35e25d33c670cfdfd99339fb1e4 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Mon, 7 Jul 2003 07:41:07 +0000 Subject: [PATCH] (AC_C_INLINE): Wrap the '#define inline ...' inside '#ifndef __cplusplus'. Problem reported by Bob Friesenhahn. --- lib/autoconf/c.m4 | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/lib/autoconf/c.m4 b/lib/autoconf/c.m4 index a560562b..a1eae889 100644 --- a/lib/autoconf/c.m4 +++ b/lib/autoconf/c.m4 @@ -1020,12 +1020,25 @@ $ac_kw foo_t foo () {return 0; } [ac_cv_c_inline=$ac_kw; break]) done ]) +AH_VERBATIM([inline], +[/* Define to `__inline__' or `__inline' if that's what the C compiler + calls it, or to nothing if 'inline' is not supported under any name. */ +#ifndef __cplusplus +#undef inline +#endif]) case $ac_cv_c_inline in inline | yes) ;; - no) AC_DEFINE(inline,, - [Define as `__inline' if that's what the C compiler calls it, - or to nothing if it is not supported.]) ;; - *) AC_DEFINE_UNQUOTED(inline, $ac_cv_c_inline) ;; + *) + case $ac_cv_c_inline in + no) ac_val=;; + *) ac_val=$ac_cv_c_inline;; + esac + cat >>confdefs.h <<_ACEOF +#ifndef __cplusplus +#define inline $ac_val +#endif +_ACEOF + ;; esac ])# AC_C_INLINE