922 |
# Do nothing if the compiler accepts the inline keyword. |
# Do nothing if the compiler accepts the inline keyword. |
923 |
# Otherwise define inline to __inline__ or __inline if one of those work, |
# Otherwise define inline to __inline__ or __inline if one of those work, |
924 |
# otherwise define inline to be empty. |
# otherwise define inline to be empty. |
925 |
|
# |
926 |
|
# HP C version B.11.11.04 doesn't allow a typedef as the return value for an |
927 |
|
# inline function, only builtin types. |
928 |
|
# |
929 |
AC_DEFUN([AC_C_INLINE], |
AC_DEFUN([AC_C_INLINE], |
930 |
[AC_REQUIRE([AC_PROG_CC_STDC])dnl |
[AC_REQUIRE([AC_PROG_CC_STDC])dnl |
931 |
AC_CACHE_CHECK([for inline], ac_cv_c_inline, |
AC_CACHE_CHECK([for inline], ac_cv_c_inline, |
933 |
for ac_kw in inline __inline__ __inline; do |
for ac_kw in inline __inline__ __inline; do |
934 |
AC_COMPILE_IFELSE([AC_LANG_SOURCE( |
AC_COMPILE_IFELSE([AC_LANG_SOURCE( |
935 |
[#ifndef __cplusplus |
[#ifndef __cplusplus |
936 |
static $ac_kw int static_foo () {return 0; } |
typedef int foo_t; |
937 |
$ac_kw int foo () {return 0; } |
static $ac_kw foo_t static_foo () {return 0; } |
938 |
|
$ac_kw foo_t foo () {return 0; } |
939 |
#endif |
#endif |
940 |
])], |
])], |
941 |
[ac_cv_c_inline=$ac_kw; break]) |
[ac_cv_c_inline=$ac_kw; break]) |