1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-27 12:41:57 +03:00

Rely on __func__ being supported

Previously we fell back to __FUNCTION__ and then NULL. As __func__ is in C99
that shouldn't be necessary anymore.

Solution.pm defined HAVE_FUNCNAME__FUNCTION instead of
HAVE_FUNCNAME__FUNC (originating in 4164e6636e), as at some point in the past
MSVC only supported __FUNCTION__. Our minimum version supports __func__.

Reviewed-By: Thomas Munro <thomas.munro@gmail.com>
Discussion: https://postgr.es/m/20220807012914.ydz73yte6j3coulo@awork3.anarazel.de
This commit is contained in:
Andres Freund
2022-08-07 09:36:01 -07:00
parent afe58c8b74
commit 320f92b744
9 changed files with 5 additions and 112 deletions

61
configure vendored
View File

@ -14937,67 +14937,6 @@ cat >>confdefs.h <<_ACEOF
_ACEOF
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for __func__" >&5
$as_echo_n "checking for __func__... " >&6; }
if ${pgac_cv_funcname_func_support+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <stdio.h>
int
main ()
{
printf("%s\n", __func__);
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
pgac_cv_funcname_func_support=yes
else
pgac_cv_funcname_func_support=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_funcname_func_support" >&5
$as_echo "$pgac_cv_funcname_func_support" >&6; }
if test x"$pgac_cv_funcname_func_support" = xyes ; then
$as_echo "#define HAVE_FUNCNAME__FUNC 1" >>confdefs.h
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for __FUNCTION__" >&5
$as_echo_n "checking for __FUNCTION__... " >&6; }
if ${pgac_cv_funcname_function_support+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <stdio.h>
int
main ()
{
printf("%s\n", __FUNCTION__);
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
pgac_cv_funcname_function_support=yes
else
pgac_cv_funcname_function_support=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_funcname_function_support" >&5
$as_echo "$pgac_cv_funcname_function_support" >&6; }
if test x"$pgac_cv_funcname_function_support" = xyes ; then
$as_echo "#define HAVE_FUNCNAME__FUNCTION 1" >>confdefs.h
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for _Static_assert" >&5
$as_echo_n "checking for _Static_assert... " >&6; }
if ${pgac_cv__static_assert+:} false; then :