Skip to content

Commit 15abc77

Browse files
committed
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.
1 parent ad81c99 commit 15abc77

File tree

6 files changed

+181
-144
lines changed

6 files changed

+181
-144
lines changed

config/c-compiler.m4

+32-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Macros to detect C compiler features
2-
# $Header: /cvsroot/pgsql/config/c-compiler.m4,v 1.3 2000/08/29 09:36:37 petere Exp $
2+
# $Header: /cvsroot/pgsql/config/c-compiler.m4,v 1.4 2001/12/02 11:38:40 petere Exp $
33

44

55
# PGAC_C_SIGNED
@@ -117,3 +117,34 @@ AC_DEFINE_UNQUOTED(AC_TYPE_NAME, $AC_CV_NAME, [The alignment requirement of a `]
117117
undefine([AC_TYPE_NAME])dnl
118118
undefine([AC_CV_NAME])dnl
119119
])# PGAC_CHECK_ALIGNOF
120+
121+
122+
# PGAC_CHECK_TYPE(TYPE, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND], [INCLUDES])
123+
# ---------------------------------------------------------------------------
124+
125+
AC_DEFUN([PGAC_CHECK_TYPE],
126+
[changequote(<<,>>)dnl
127+
dnl The name to #define
128+
define(<<AC_TYPE_NAME>>, translit(have_$1, [a-z *], [A-Z_P]))dnl
129+
dnl The cache variable name.
130+
define(<<AC_CV_NAME>>, translit(pgac_cv_have_$1, [ *], [_p]))dnl
131+
changequote([, ])dnl
132+
AC_CACHE_CHECK([for $1], AC_CV_NAME,
133+
[AC_TRY_COMPILE([$4],
134+
[if (($1 *) 0)
135+
return 0;
136+
if (sizeof ($1))
137+
return 0;],
138+
AC_CV_NAME[=yes],
139+
AC_CV_NAME[=no])])
140+
if test "$AC_CV_NAME" = yes; then
141+
AC_DEFINE(AC_TYPE_NAME, 1, [Define to 1 if you have `]$1['])
142+
ifelse($2,,,[$2
143+
])[]dnl
144+
ifelse($3,,,[else
145+
$3
146+
])[]dnl
147+
fi
148+
undefine([AC_TYPE_NAME])dnl
149+
undefine([AC_CV_NAME])dnl
150+
])# PGAC_CHECK_TYPE

0 commit comments

Comments
 (0)