From 7c57b746de3116c9c6c1f6334113e39d338ced6e Mon Sep 17 00:00:00 2001 From: Richard Kreckel Date: Fri, 15 Feb 2008 23:51:10 +0000 Subject: [PATCH] * More robust definition of CL_HAVE_ATTRIBUTE_FLATTEN. --- ChangeLog | 5 +++++ m4/cc.m4 | 12 ++++++++---- src/base/cl_maybe_inline.h | 2 +- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2129a89..19b764c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2007-02-15 Richard B. Kreckel + + * m4/cc.m4 (CL_HAVE_ATTRIBUTE_FLATTEN): More robust definition allows... + * src/base/cl_maybe_inline.h (CL_FLATTEN): ...simplification here. + 2007-02-10 Richard B. Kreckel * autoconf/ltmain.sh: Update to libtool-1.5.26. diff --git a/m4/cc.m4 b/m4/cc.m4 index 0925662..768dba1 100644 --- a/m4/cc.m4 +++ b/m4/cc.m4 @@ -76,11 +76,15 @@ AC_CACHE_CHECK([whether the compiler supports __attribute__((flatten))], cl_cv_h cat > conftest.cc </dev/null 2>conftest.out) -if grep -i "warning" conftest.out > /dev/null; then - cl_cv_have_attr_flatten=no +if AC_TRY_COMMAND(${CXX-g++} $CXXFLAGS -c conftest.cc >/dev/null 2>conftest.stderr) +then + if grep -i "warning" conftest.stderr > /dev/null; then + cl_cv_have_attr_flatten=no + else + cl_cv_have_attr_flatten=yes + fi else - cl_cv_have_attr_flatten=yes + cl_cv_have_attr_flatten=no fi rm -f conftest* ]) diff --git a/src/base/cl_maybe_inline.h b/src/base/cl_maybe_inline.h index 9d185f4..77073a3 100644 --- a/src/base/cl_maybe_inline.h +++ b/src/base/cl_maybe_inline.h @@ -102,7 +102,7 @@ * a function. * 2. It's ignored if the optimization is switched off. */ -#if defined(__GNUC__) && defined(CL_HAVE_ATTRIBUTE_FLATTEN) +#if defined(CL_HAVE_ATTRIBUTE_FLATTEN) #define CL_FLATTEN __attribute__((flatten)) #else #define CL_FLATTEN