diff options
author | Peter Eisentraut <peter_e@gmx.net> | 2001-12-02 11:38:40 +0000 |
---|---|---|
committer | Peter Eisentraut <peter_e@gmx.net> | 2001-12-02 11:38:40 +0000 |
commit | 15abc7788e66ab4b456dabdc8ebb0565113b1b32 (patch) | |
tree | 727fee4b96031c96c2fcae4060a85c912d3c01f4 /config | |
parent | ad81c999846e2360a5bf55c6e4d49696b72009b6 (diff) | |
download | postgresql-15abc7788e66ab4b456dabdc8ebb0565113b1b32.tar.gz |
More correct way to check for existence of types, which allows to specify
which include files to consider. Should fix BeOS problems with int8 types.
Diffstat (limited to 'config')
-rw-r--r-- | config/c-compiler.m4 | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/config/c-compiler.m4 b/config/c-compiler.m4 index 8db95b90ac..e977114195 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.3 2000/08/29 09:36:37 petere Exp $ +# $Header: /cvsroot/pgsql/config/c-compiler.m4,v 1.4 2001/12/02 11:38:40 petere Exp $ # PGAC_C_SIGNED @@ -117,3 +117,34 @@ AC_DEFINE_UNQUOTED(AC_TYPE_NAME, $AC_CV_NAME, [The alignment requirement of a `] undefine([AC_TYPE_NAME])dnl undefine([AC_CV_NAME])dnl ])# PGAC_CHECK_ALIGNOF + + +# PGAC_CHECK_TYPE(TYPE, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND], [INCLUDES]) +# --------------------------------------------------------------------------- + +AC_DEFUN([PGAC_CHECK_TYPE], +[changequote(<<,>>)dnl +dnl The name to #define +define(<<AC_TYPE_NAME>>, translit(have_$1, [a-z *], [A-Z_P]))dnl +dnl The cache variable name. +define(<<AC_CV_NAME>>, translit(pgac_cv_have_$1, [ *], [_p]))dnl +changequote([, ])dnl +AC_CACHE_CHECK([for $1], AC_CV_NAME, +[AC_TRY_COMPILE([$4], +[if (($1 *) 0) + return 0; +if (sizeof ($1)) + return 0;], +AC_CV_NAME[=yes], +AC_CV_NAME[=no])]) +if test "$AC_CV_NAME" = yes; then + AC_DEFINE(AC_TYPE_NAME, 1, [Define to 1 if you have `]$1[']) + ifelse($2,,,[$2 +])[]dnl +ifelse($3,,,[else + $3 +])[]dnl +fi +undefine([AC_TYPE_NAME])dnl +undefine([AC_CV_NAME])dnl +])# PGAC_CHECK_TYPE |