Blame gnulib/m4/strnlen.m4

Packit eba2e2
# strnlen.m4 serial 13
Packit eba2e2
dnl Copyright (C) 2002-2003, 2005-2007, 2009-2014 Free Software Foundation,
Packit eba2e2
dnl Inc.
Packit eba2e2
dnl This file is free software; the Free Software Foundation
Packit eba2e2
dnl gives unlimited permission to copy and/or distribute it,
Packit eba2e2
dnl with or without modifications, as long as this notice is preserved.
Packit eba2e2
Packit eba2e2
AC_DEFUN([gl_FUNC_STRNLEN],
Packit eba2e2
[
Packit eba2e2
  AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS])
Packit eba2e2
Packit eba2e2
  dnl Persuade glibc <string.h> to declare strnlen().
Packit eba2e2
  AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
Packit eba2e2
Packit eba2e2
  AC_CHECK_DECLS_ONCE([strnlen])
Packit eba2e2
  if test $ac_cv_have_decl_strnlen = no; then
Packit eba2e2
    HAVE_DECL_STRNLEN=0
Packit eba2e2
  else
Packit eba2e2
    m4_pushdef([AC_LIBOBJ], [:])
Packit eba2e2
    dnl Note: AC_FUNC_STRNLEN does AC_LIBOBJ([strnlen]).
Packit eba2e2
    AC_FUNC_STRNLEN
Packit eba2e2
    m4_popdef([AC_LIBOBJ])
Packit eba2e2
    if test $ac_cv_func_strnlen_working = no; then
Packit eba2e2
      REPLACE_STRNLEN=1
Packit eba2e2
    fi
Packit eba2e2
  fi
Packit eba2e2
])
Packit eba2e2
Packit eba2e2
# Prerequisites of lib/strnlen.c.
Packit eba2e2
AC_DEFUN([gl_PREREQ_STRNLEN], [:])