summaryrefslogtreecommitdiff
path: root/config/c-compiler.m4
diff options
context:
space:
mode:
authorPavan Deolasee2017-06-14 05:42:18 +0000
committerPavan Deolasee2017-06-14 05:42:18 +0000
commit15dd5274c323fb93e4e3ea9ad2185aaaec10f79c (patch)
tree9dafb4c7f735d9429ea461dc792933af87493c33 /config/c-compiler.m4
parentdfbb88e3bbb526dcb204b456b9e5cfd9d10d0d0a (diff)
parentd5cb3bab564e0927ffac7c8729eacf181a12dd40 (diff)
Merge from PG master upto d5cb3bab564e0927ffac7c8729eacf181a12dd40
This is the result of the "git merge remotes/PGSQL/master" upto the said commit point. We have done some basic analysis, fixed compilation problems etc, but bulk of the logical problems in conflict resolution etc will be handled by subsequent commits.
Diffstat (limited to 'config/c-compiler.m4')
-rw-r--r--config/c-compiler.m455
1 files changed, 54 insertions, 1 deletions
diff --git a/config/c-compiler.m4 b/config/c-compiler.m4
index a7f6773ae1..7275ea69fe 100644
--- a/config/c-compiler.m4
+++ b/config/c-compiler.m4
@@ -71,8 +71,10 @@ int does_int64_work()
return 0;
return 1;
}
+
+int
main() {
- exit(! does_int64_work());
+ return (! does_int64_work());
}])],
[Ac_cachevar=yes],
[Ac_cachevar=no],
@@ -176,6 +178,33 @@ fi])# PGAC_C_STATIC_ASSERT
+# PGAC_C_TYPEOF
+# -------------
+# Check if the C compiler understands typeof or a variant. Define
+# HAVE_TYPEOF if so, and define 'typeof' to the actual key word.
+#
+AC_DEFUN([PGAC_C_TYPEOF],
+[AC_CACHE_CHECK(for typeof, pgac_cv_c_typeof,
+[pgac_cv_c_typeof=no
+for pgac_kw in typeof __typeof__ decltype; do
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],
+[int x = 0;
+$pgac_kw(x) y;
+y = x;
+return y;])],
+[pgac_cv_c_typeof=$pgac_kw])
+ test "$pgac_cv_c_typeof" != no && break
+done])
+if test "$pgac_cv_c_typeof" != no; then
+ AC_DEFINE(HAVE_TYPEOF, 1,
+ [Define to 1 if your compiler understands `typeof' or something similar.])
+ if test "$pgac_cv_c_typeof" != typeof; then
+ AC_DEFINE_UNQUOTED(typeof, $pgac_cv_c_typeof, [Define to how the compiler spells `typeof'.])
+ fi
+fi])# PGAC_C_TYPEOF
+
+
+
# PGAC_C_TYPES_COMPATIBLE
# -----------------------
# Check if the C compiler understands __builtin_types_compatible_p,
@@ -271,6 +300,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,