tail: avoid theoretically undefined behavior
[coreutils/ericb.git] / m4 / check-decl.m4
blobfd5865332e1700801f2144d808039881a2c81fb5
1 #serial 26
2 # Check declarations for this package.
4 dnl Copyright (C) 1997-2001, 2003-2006, 2008-2011 Free Software Foundation,
5 dnl Inc.
7 dnl This file is free software; the Free Software Foundation
8 dnl gives unlimited permission to copy and/or distribute it,
9 dnl with or without modifications, as long as this notice is preserved.
12 dnl This is just a wrapper function to encapsulate this kludge.
13 dnl Putting it in a separate file like this helps share it between
14 dnl different packages.
15 AC_DEFUN([gl_CHECK_DECLS],
17   AC_REQUIRE([AC_HEADER_TIME])
19   AC_CHECK_HEADERS_ONCE([grp.h pwd.h])
20   headers='
21 #include <sys/types.h>
23 #include <unistd.h>
25 #if HAVE_GRP_H
26 # include <grp.h>
27 #endif
29 #if HAVE_PWD_H
30 # include <pwd.h>
31 #endif
33   AC_CHECK_DECLS([
34     getgrgid,
35     getpwuid,
36     ttyname], , , $headers)
38   AC_CHECK_DECLS_ONCE([geteuid])
39   AC_CHECK_DECLS_ONCE([getlogin])
40   AC_CHECK_DECLS_ONCE([getuid])