Blame m4/inline.m4

Packit Service a2489d
# inline.m4 serial 4
Packit Service a2489d
dnl Copyright (C) 2006, 2009-2018 Free Software Foundation, Inc.
Packit Service a2489d
dnl This file is free software; the Free Software Foundation
Packit Service a2489d
dnl gives unlimited permission to copy and/or distribute it,
Packit Service a2489d
dnl with or without modifications, as long as this notice is preserved.
Packit Service a2489d
Packit Service a2489d
dnl Test for the 'inline' keyword or equivalent.
Packit Service a2489d
dnl Define 'inline' to a supported equivalent, or to nothing if not supported,
Packit Service a2489d
dnl like AC_C_INLINE does.  Also, define HAVE_INLINE if 'inline' or an
Packit Service a2489d
dnl equivalent is effectively supported, i.e. if the compiler is likely to
Packit Service a2489d
dnl drop unused 'static inline' functions.
Packit Service a2489d
AC_DEFUN([gl_INLINE],
Packit Service a2489d
[
Packit Service a2489d
  AC_REQUIRE([AC_C_INLINE])
Packit Service a2489d
  AC_CACHE_CHECK([whether the compiler generally respects inline],
Packit Service a2489d
    [gl_cv_c_inline_effective],
Packit Service a2489d
    [if test $ac_cv_c_inline = no; then
Packit Service a2489d
       gl_cv_c_inline_effective=no
Packit Service a2489d
     else
Packit Service a2489d
       dnl GCC defines __NO_INLINE__ if not optimizing or if -fno-inline is
Packit Service a2489d
       dnl specified.
Packit Service a2489d
       dnl Use AC_COMPILE_IFELSE here, not AC_EGREP_CPP, because the result
Packit Service a2489d
       dnl depends on optimization flags, which can be in CFLAGS.
Packit Service a2489d
       dnl (AC_EGREP_CPP looks only at the CPPFLAGS.)
Packit Service a2489d
       AC_COMPILE_IFELSE(
Packit Service a2489d
         [AC_LANG_PROGRAM([[]],
Packit Service a2489d
           [[#ifdef __NO_INLINE__
Packit Service a2489d
               #error "inline is not effective"
Packit Service a2489d
             #endif]])],
Packit Service a2489d
         [gl_cv_c_inline_effective=yes],
Packit Service a2489d
         [gl_cv_c_inline_effective=no])
Packit Service a2489d
     fi
Packit Service a2489d
    ])
Packit Service a2489d
  if test $gl_cv_c_inline_effective = yes; then
Packit Service a2489d
    AC_DEFINE([HAVE_INLINE], [1],
Packit Service a2489d
      [Define to 1 if the compiler supports one of the keywords
Packit Service a2489d
       'inline', '__inline__', '__inline' and effectively inlines
Packit Service a2489d
       functions marked as such.])
Packit Service a2489d
  fi
Packit Service a2489d
])