]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
(AC_C_INLINE): Wrap the '#define inline ...'
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 7 Jul 2003 07:41:07 +0000 (07:41 +0000)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 7 Jul 2003 07:41:07 +0000 (07:41 +0000)
inside '#ifndef __cplusplus'.  Problem reported by
Bob Friesenhahn.

lib/autoconf/c.m4

index a560562bf7f0f5fa213ec938b5feed645d2c2593..a1eae889a505e88a8273d5462ad8f8d1a0f4c2fb 100644 (file)
@@ -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