Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit8799d84

Browse files
committed
Add memcmp() test and new memcmp.c file, for SunOS. Tested by Tatsuo.
1 parent960f6a5 commit8799d84

File tree

6 files changed

+265
-158
lines changed

6 files changed

+265
-158
lines changed

‎config/c-library.m4

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Macros that test various C library quirks
2-
# $Header: /cvsroot/pgsql/config/c-library.m4,v 1.9 2001/09/07 19:52:53 momjian Exp $
2+
# $Header: /cvsroot/pgsql/config/c-library.m4,v 1.10 2001/12/20 21:23:05 momjian Exp $
33

44

55
# PGAC_VAR_INT_TIMEZONE
@@ -36,6 +36,30 @@ if test x"$pgac_cv_func_gettimeofday_1arg" = xyes ; then
3636
fi])# PGAC_FUNC_GETTIMEOFDAY_1ARG
3737

3838

39+
# PGAC_FUNC_MEMCMP
40+
# -----------
41+
# Check if memcmp() properly handles negative bytes and returns +/-.
42+
# SunOS does not.
43+
# AC_FUNC_MEMCMP
44+
AC_DEFUN(PGAC_FUNC_MEMCMP,
45+
[AC_CACHE_CHECK(for8-bitcleanmemcmp,pgac_cv_func_memcmp_clean,
46+
[AC_TRY_RUN([
47+
main()
48+
{
49+
char c0 = 0x40, c1 = 0x80, c2 = 0x81;
50+
exit(memcmp(&c0, &c2, 1) < 0 && memcmp(&c1, &c2, 1) < 0 ? 0 : 1);
51+
}
52+
],pgac_cv_func_memcmp_clean=yes,pgac_cv_func_memcmp_clean=no,
53+
pgac_cv_func_memcmp_clean=no)])
54+
if test $pgac_cv_func_memcmp_clean = no ; then
55+
MEMCMP=memcmp.o
56+
else
57+
MEMCMP=
58+
fi
59+
AC_SUBST(MEMCMP)dnl
60+
])
61+
62+
3963
# PGAC_UNION_SEMUN
4064
# ----------------
4165
# Check if `union semun' exists. Define HAVE_UNION_SEMUN if so.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp