3 dnl A replacement for autoconf's AC_FUNC_MEMCMP that detects
4 dnl the losing memcmp on some x86 Next systems.
5 AC_DEFUN(jm_AC_FUNC_MEMCMP,
6 [AC_CACHE_CHECK([for working memcmp], jm_cv_func_memcmp_working,
11 /* Some versions of memcmp are not 8-bit clean. */
12 char c0 = 0x40, c1 = 0x80, c2 = 0x81;
13 if (memcmp(&c0, &c2, 1) >= 0 || memcmp(&c1, &c2, 1) >= 0)
16 /* The Next x86 OpenStep bug shows up only when comparing 16 bytes
17 or more and with at least one buffer not starting on a 4-byte boundary.
18 William Lewis provided this test program. */
23 for (i = 0; i < 4; i++)
27 strcpy (a, "--------01111111");
28 strcpy (b, "--------10000000");
29 if (memcmp (a, b, 16) >= 0)
35 jm_cv_func_memcmp_working=yes,
36 jm_cv_func_memcmp_working=no,
37 jm_cv_func_memcmp_working=no)])
38 test $jm_cv_func_memcmp_working = no \
42 AC_DEFUN(jm_FUNC_MEMCMP,
43 [AC_REQUIRE([jm_AC_FUNC_MEMCMP])dnl
44 if test $jm_cv_func_memcmp_working = no; then
45 AC_DEFINE_UNQUOTED(memcmp, rpl_memcmp,
46 [Define to rpl_memcmp if the replacement function should be used.])