summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2001-12-20 21:23:05 +0000
committerBruce Momjian <bruce@momjian.us>2001-12-20 21:23:05 +0000
commit8799d84603d607f614198d7967ee6cff0d274ff4 (patch)
tree11883d415291e68f3b940b7b0fec47aba6d97cbb /config
parent960f6a5fdf9aafea93585cd7a4cef5044aebe078 (diff)
downloadpostgresql-8799d84603d607f614198d7967ee6cff0d274ff4.tar.gz
Add memcmp() test and new memcmp.c file, for SunOS. Tested by Tatsuo.
Diffstat (limited to 'config')
-rw-r--r--config/c-library.m426
1 files changed, 25 insertions, 1 deletions
diff --git a/config/c-library.m4 b/config/c-library.m4
index 6558f29f62..3232b09d59 100644
--- a/config/c-library.m4
+++ b/config/c-library.m4
@@ -1,5 +1,5 @@
# Macros that test various C library quirks
-# $Header: /cvsroot/pgsql/config/c-library.m4,v 1.9 2001/09/07 19:52:53 momjian Exp $
+# $Header: /cvsroot/pgsql/config/c-library.m4,v 1.10 2001/12/20 21:23:05 momjian Exp $
# PGAC_VAR_INT_TIMEZONE
@@ -36,6 +36,30 @@ if test x"$pgac_cv_func_gettimeofday_1arg" = xyes ; then
fi])# PGAC_FUNC_GETTIMEOFDAY_1ARG
+# PGAC_FUNC_MEMCMP
+# -----------
+# Check if memcmp() properly handles negative bytes and returns +/-.
+# SunOS does not.
+# AC_FUNC_MEMCMP
+AC_DEFUN(PGAC_FUNC_MEMCMP,
+[AC_CACHE_CHECK(for 8-bit clean memcmp, pgac_cv_func_memcmp_clean,
+[AC_TRY_RUN([
+main()
+{
+ char c0 = 0x40, c1 = 0x80, c2 = 0x81;
+ exit(memcmp(&c0, &c2, 1) < 0 && memcmp(&c1, &c2, 1) < 0 ? 0 : 1);
+}
+], pgac_cv_func_memcmp_clean=yes, pgac_cv_func_memcmp_clean=no,
+pgac_cv_func_memcmp_clean=no)])
+if test $pgac_cv_func_memcmp_clean = no ; then
+ MEMCMP=memcmp.o
+else
+ MEMCMP=
+fi
+AC_SUBST(MEMCMP)dnl
+])
+
+
# PGAC_UNION_SEMUN
# ----------------
# Check if `union semun' exists. Define HAVE_UNION_SEMUN if so.