[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Using AC_C_INLINE blows up C++ tests
From: |
Albert Chin |
Subject: |
Re: Using AC_C_INLINE blows up C++ tests |
Date: |
Thu, 26 Jun 2003 09:18:08 -0500 |
User-agent: |
Mutt/1.4i |
On Sun, Jun 08, 2003 at 08:41:06AM +1000, Kevin Ryde wrote:
> Assar Westerlund <address@hidden> writes:
> >
> > +AH_VERBATIM([inlind], [
> > +#ifndef __cplusplus
> > +])
>
> It's probably cleaner to use an AH_VERBATIM for the whole thing. I've
> has some joy from th following (and no description are in the AC_DEFINEs).
>
> AH_VERBATIM(inline,
> [/* Define as `__inline' if that's what the C compiler calls it, or to nothing
> if it is not supported. */
> #ifndef __cplusplus
> #undef inline
> #endif])
How about the patch below.
--
albert chin (address@hidden)
-- snip snip
--- lib/autoconf/c.m4.orig Sun Dec 22 22:10:46 2002
+++ lib/autoconf/c.m4 Wed Jun 25 09:43:09 2003
@@ -997,10 +1004,27 @@
])
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) ;;
+ *)
+AH_VERBATIM([inline],
+[/* Define as `__inline' if that's what the C compiler calls it,
+ or to nothing if it is not supported. */
+#ifndef __cplusplus
+#undef inline
+#endif])
+ if test "x$ac_cv_c_inline" = "xno"; then
+ cat >>confdefs.h <<_ACEOF
+#ifndef __cplusplus
+#define inline
+#endif
+_ACEOF
+ else
+ cat >>confdefs.h <<_ACEOF
+#ifndef __cplusplus
+#define inline $ac_cv_c_inline
+#endif
+_ACEOF
+ fi
+ ;;
esac
])# AC_C_INLINE