X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=m4%2Finline.m4;h=c49957f80a03ad86af24ad685b71b1322de8543e;hb=7ef6c64e210ac0979d7e8ac69bc5b5208c2405ab;hp=2810dd1a22295e11c055d8f6e5946ee716c1febc;hpb=68de1516997f552b68c0f67db650de8b57367e12;p=gnulib.git diff --git a/m4/inline.m4 b/m4/inline.m4 index 2810dd1a2..c49957f80 100644 --- a/m4/inline.m4 +++ b/m4/inline.m4 @@ -1,5 +1,5 @@ -# inline.m4 serial 2 -dnl Copyright (C) 2006 Free Software Foundation, Inc. +# inline.m4 serial 4 +dnl Copyright (C) 2006, 2009-2014 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -19,15 +19,20 @@ AC_DEFUN([gl_INLINE], else dnl GCC defines __NO_INLINE__ if not optimizing or if -fno-inline is dnl specified. - AC_EGREP_CPP([bummer], [ - #ifdef __NO_INLINE__ - bummer - #endif - ], [gl_cv_c_inline_effective=no], [gl_cv_c_inline_effective=yes]) + dnl Use AC_COMPILE_IFELSE here, not AC_EGREP_CPP, because the result + dnl depends on optimization flags, which can be in CFLAGS. + dnl (AC_EGREP_CPP looks only at the CPPFLAGS.) + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[]], + [[#ifdef __NO_INLINE__ + #error "inline is not effective" + #endif]])], + [gl_cv_c_inline_effective=yes], + [gl_cv_c_inline_effective=no]) fi ]) if test $gl_cv_c_inline_effective = yes; then - AC_DEFINE([HAVE_INLINE], 1, + AC_DEFINE([HAVE_INLINE], [1], [Define to 1 if the compiler supports one of the keywords 'inline', '__inline__', '__inline' and effectively inlines functions marked as such.])