Bob Friesenhahn <[EMAIL PROTECTED]> writes:
> The main Autoconf issue is that each feature test program includes all
> the #defines generated from any previous test. This means that if
> AC_C_INLINE has been executed previously, then a define like
>
> #define inline __inline
>
> may be automatically generated as part of conftest.c, which causes C++
> tests which include C++ headers or otherwise use inline to fail.
The patch below seems to make it work correctly for me (for inline and
C++). The autoheader tricks is use is kind of evil, and doing this
right would require going through all the macros and see which of them
apply for C++. And this would be a backwards-incompatible change, but
that should not be a problem since I cannot see how it could have
worked usefully for people.
--- c.m4.~1.179.~ Wed May 28 17:30:26 2003
+++ c.m4 Sat Jun 7 13:42:23 2003
@@ -1010,6 +1010,12 @@
[ac_cv_c_inline=$ac_kw; break])
done
])
+AH_VERBATIM([inlind], [
+#ifndef __cplusplus
+])
+cat >>confdefs.h <<\_ACEOF
+#ifndef __cplusplus
+_ACEOF
case $ac_cv_c_inline in
inline | yes) ;;
no) AC_DEFINE(inline,,
@@ -1017,6 +1023,12 @@
or to nothing if it is not supported.]) ;;
*) AC_DEFINE_UNQUOTED(inline, $ac_cv_c_inline) ;;
esac
+cat >>confdefs.h <<\_ACEOF
+#endif /* __cplusplus */
+_ACEOF
+AH_VERBATIM([inlinf], [
+#endif /* __cplusplus */
+])
])# AC_C_INLINE