From e08ab7c3127c10d419e91072c68e1bfeaab025b8 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Sat, 13 Feb 2010 02:34:16 +0000 Subject: Support inlining various small performance-critical functions on non-GCC compilers, by applying a configure check to see if the compiler will accept an unreferenced "static inline foo ..." function without warnings. It is believed that such warnings are the only reason not to declare inlined functions in headers, if the compiler understands "inline" at all. Kurt Harriman --- configure | 69 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) (limited to 'configure') diff --git a/configure b/configure index 62999b4ec3..c0ca7bc457 100755 --- a/configure +++ b/configure @@ -14535,6 +14535,75 @@ _ACEOF ;; esac +{ $as_echo "$as_me:$LINENO: checking for quiet inline (no complaint if unreferenced)" >&5 +$as_echo_n "checking for quiet inline (no complaint if unreferenced)... " >&6; } +if test "${pgac_cv_c_inline_quietly+set}" = set; then + $as_echo_n "(cached) " >&6 +else + pgac_cv_c_inline_quietly=no + if test "$ac_cv_c_inline" != no; then + pgac_c_inline_save_werror=$ac_c_werror_flag + ac_c_werror_flag=yes + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +static inline int fun () {return 0;} +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + pgac_cv_c_inline_quietly=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext + ac_c_werror_flag=$pgac_c_inline_save_werror + fi +fi +{ $as_echo "$as_me:$LINENO: result: $pgac_cv_c_inline_quietly" >&5 +$as_echo "$pgac_cv_c_inline_quietly" >&6; } +if test "$pgac_cv_c_inline_quietly" != no; then + +cat >>confdefs.h <<_ACEOF +#define USE_INLINE 1 +_ACEOF + +fi + { $as_echo "$as_me:$LINENO: checking for preprocessor stringizing operator" >&5 $as_echo_n "checking for preprocessor stringizing operator... " >&6; } if test "${ac_cv_c_stringize+set}" = set; then -- cgit v1.2.1