diff options
Diffstat (limited to 'config/c-compiler.m4')
-rw-r--r-- | config/c-compiler.m4 | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/config/c-compiler.m4 b/config/c-compiler.m4 index 52cb7c09150..5d72e1377b5 100644 --- a/config/c-compiler.m4 +++ b/config/c-compiler.m4 @@ -1,5 +1,5 @@ # Macros to detect C compiler features -# $Header: /cvsroot/pgsql/config/c-compiler.m4,v 1.7 2003/04/06 22:45:22 petere Exp $ +# $Header: /cvsroot/pgsql/config/c-compiler.m4,v 1.8 2003/04/24 21:16:42 tgl Exp $ # PGAC_C_SIGNED @@ -94,3 +94,29 @@ AC_DEFINE_UNQUOTED(AS_TR_CPP(alignof_$1), [$AS_TR_SH([pgac_cv_alignof_$1])], [The alignment requirement of a `$1'.]) ])# PGAC_CHECK_ALIGNOF + + +# PGAC_C_FUNCNAME_SUPPORT +# ------------- +# Check if the C compiler understands __func__ (C99) or __FUNCTION__ (gcc). +# Define HAVE_FUNCNAME__FUNC or HAVE_FUNCNAME__FUNCTION accordingly. +AC_DEFUN([PGAC_C_FUNCNAME_SUPPORT], +[AC_CACHE_CHECK(for __func__, pgac_cv_funcname_func_support, +[AC_TRY_COMPILE([#include <stdio.h>], +[printf("%s\n", __func__);], +[pgac_cv_funcname_func_support=yes], +[pgac_cv_funcname_func_support=no])]) +if test x"$pgac_cv_funcname_func_support" = xyes ; then +AC_DEFINE(HAVE_FUNCNAME__FUNC, 1, + [Define to 1 if your compiler understands __func__.]) +else +AC_CACHE_CHECK(for __FUNCTION__, pgac_cv_funcname_function_support, +[AC_TRY_COMPILE([#include <stdio.h>], +[printf("%s\n", __FUNCTION__);], +[pgac_cv_funcname_function_support=yes], +[pgac_cv_funcname_function_support=no])]) +if test x"$pgac_cv_funcname_function_support" = xyes ; then +AC_DEFINE(HAVE_FUNCNAME__FUNCTION, 1, + [Define to 1 if your compiler understands __FUNCTION__.]) +fi +fi])# PGAC_C_FUNCNAME_SUPPORT |