AC_CHECK_TYPES([long long])
AC_CHECK_TYPES([signed char])
AC_CHECK_TYPES([ssize_t])
+
+AC_CHECK_SIZEOF([bool], [],
+[#ifdef HAVE_STDBOOL_H
+#include <stdbool.h>
+#endif])
+
+dnl We use <stdbool.h> if we have it and it declares type bool as having
+dnl size 1. Otherwise, c.h will fall back to declaring bool as unsigned char.
+if test "$ac_cv_header_stdbool_h" = yes -a "$ac_cv_sizeof_bool" = 1; then
+ AC_DEFINE([PG_USE_STDBOOL], 1,
+ [Define to 1 to use <stdbool.h> to define type bool.])
+fi
+
AC_TYPE_SIZE_T
# Check if "-Wall" is valid
AC_CHECK_HEADERS(locale.h sys/time.h uchar.h)
AC_CHECK_HEADER(libpq-fe.h,,[AC_MSG_ERROR([libpq header not found])])
AC_HEADER_TIME
+AC_HEADER_STDBOOL
# 4. Types(all members were moved to 0.)
#endif /* CALLBACK */
#endif /* WIN32 */
+#ifndef __cplusplus
+
+#ifdef PG_USE_STDBOOL
+#include <stdbool.h>
+#else
+
+#ifndef bool
+typedef unsigned char bool;
+#endif
+
+#ifndef true
+#define true ((bool) 1)
+#endif
+
+#ifndef false
+#define false ((bool) 0)
+#endif
+
+#endif /* not PG_USE_STDBOOL */
+#endif /* not C++ */
+
+
#ifndef WIN32
#define stricmp strcasecmp
#define strnicmp strncasecmp