3 # This is already in cvs autoconf -- what will be 2.52g.
4 # Define it here for those who aren't on the bleeding edge.
5 # FIXME: remove this file once the next autoconf release comes out.
7 undefine([AC_FUNC_STRNLEN])
11 AC_DEFUN([AC_FUNC_STRNLEN],
12 [AC_CACHE_CHECK([for working strnlen], ac_cv_func_strnlen_working,
13 [AC_RUN_IFELSE([AC_LANG_PROGRAM([], [[
15 #define S_LEN (sizeof S - 1)
17 /* At least one implementation is buggy: that of AIX 4.3. */
19 for (i = 0; i < S_LEN + 1; ++i)
21 int result = i <= S_LEN ? i : S_LEN;
22 if (strnlen (S, i) != result)
27 [ac_cv_func_strnlen_working=yes],
28 [ac_cv_func_strnlen_working=no],
29 [ac_cv_func_strnlen_working=no])])
30 test $ac_cv_func_strnlen_working = no && AC_LIBOBJ([strnlen])