autoconf-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: AC_C_INLINE on recent HP C


From: Akim Demaille
Subject: Re: AC_C_INLINE on recent HP C
Date: 26 Mar 2002 09:13:14 +0100
User-agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Common Lisp)

|A recent version of HP C (B.11.11.04) doesn't seem to like "inline"
|functions returning typedefs, only builtin types.  I'd like to propose
|including a typedef in the AC_C_INLINE test program to avoid inline on
|that compiler.
|
|Perhaps some programs will only need plain types as return values, but
|since this is almost certainly a compiler bug it doesn't seem worth
|worrying about that distinction.
|
|        * lib/autoconf/c.m4 (AC_C_INLINE): Test with a typedef return value,
|        to avoid versions of HP C which don't allow that.
|
|
|Index: c.m4
|===================================================================
|RCS file: /cvsroot/autoconf/autoconf/lib/autoconf/c.m4,v
|retrieving revision 1.160
|diff -u -r1.160 c.m4
|--- c.m4       2 Mar 2002 15:19:48 -0000       1.160
|+++ c.m4       25 Mar 2002 22:46:57 -0000
|@@ -922,6 +922,10 @@
| # Do nothing if the compiler accepts the inline keyword.
| # Otherwise define inline to __inline__ or __inline if one of those work,
| # otherwise define inline to be empty.
|+#
|+# HP C version B.11.11.04 doesn't allow a typedef as the return value for an
|+# inline function, only builtin types.
|+#
| AC_DEFUN([AC_C_INLINE],
| [AC_REQUIRE([AC_PROG_CC_STDC])dnl
| AC_CACHE_CHECK([for inline], ac_cv_c_inline,
|@@ -929,8 +933,9 @@
| for ac_kw in inline __inline__ __inline; do
|   AC_COMPILE_IFELSE([AC_LANG_SOURCE(
| [#ifndef __cplusplus
|-static $ac_kw int static_foo () {return 0; }
|-$ac_kw int foo () {return 0; }
|+typedef int foo_t;
|+static $ac_kw foo_t static_foo () {return 0; }
|+$ac_kw foo_t foo () {return 0; }
| #endif
| ])],
|                     [ac_cv_c_inline=$ac_kw; break])

This is fine with me.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]