1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-11 20:28:21 +03:00

Add configure test to see if the C compiler has gcc-style computed gotos.

We'll need this for the upcoming patch to speed up expression evaluation.
Might as well push it now to see if it behaves sanely in the buildfarm.

Andres Freund

Discussion: https://postgr.es/m/20170320062511.hp5qeurtxrwsvfxr@alap3.anarazel.de
This commit is contained in:
Tom Lane
2017-03-20 13:35:21 -04:00
parent 14a72525d2
commit bc18126a6b
5 changed files with 65 additions and 0 deletions

View File

@ -273,6 +273,30 @@ fi])# PGAC_C_BUILTIN_UNREACHABLE
# PGAC_C_COMPUTED_GOTO
# -----------------------
# Check if the C compiler knows computed gotos (gcc extension, also
# available in at least clang). If so, define HAVE_COMPUTED_GOTO.
#
# Checking whether computed gotos are supported syntax-wise ought to
# be enough, as the syntax is otherwise illegal.
AC_DEFUN([PGAC_C_COMPUTED_GOTO],
[AC_CACHE_CHECK(for computed goto support, pgac_cv_computed_goto,
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],
[[void *labeladdrs[] = {&&my_label};
goto *labeladdrs[0];
my_label:
return 1;
]])],
[pgac_cv_computed_goto=yes],
[pgac_cv_computed_goto=no])])
if test x"$pgac_cv_computed_goto" = xyes ; then
AC_DEFINE(HAVE_COMPUTED_GOTO, 1,
[Define to 1 if your compiler handles computed gotos.])
fi])# PGAC_C_COMPUTED_GOTO
# PGAC_C_VA_ARGS
# --------------
# Check if the C compiler understands C99-style variadic macros,