2
dnl Copyright (C) 1993-2002 Free Software Foundation, Inc.
3
dnl This file is free software, distributed under the terms of the GNU
4
dnl General Public License. As a special exception to the GNU General
5
dnl Public License, this file may be distributed as part of a program
6
dnl that contains a configuration script generated by Autoconf, under
7
dnl the same distribution terms as the rest of that program.
9
dnl From Bruno Haible, Marcus Daniels, Sam Steingold.
13
AC_DEFUN([CL_CLOSEDIR],
14
[AC_REQUIRE([CL_DIR_HEADER])dnl
15
AC_BEFORE([$0], [CL_FILECHARSET])dnl
16
CL_PROTO([closedir], [
20
#include <sys/types.h>
23
#include <$ac_header_dirent>
24
], [int closedir (DIR* dir);], [int closedir();],
25
cl_cv_proto_closedir_ret, int, void)],
26
[extern $cl_cv_proto_closedir_ret closedir (DIR*);])
27
AC_DEFINE_UNQUOTED(RETCLOSEDIRTYPE,$cl_cv_proto_closedir_ret,[closedir() return type])
28
if test $cl_cv_proto_closedir_ret = void; then
29
AC_DEFINE(VOID_CLOSEDIR,,[closedir() return value is void or unusable])
31
# The following test is necessary, because Cygwin32 declares closedir()
32
# as returning int but the return value is unusable.
33
AC_CACHE_CHECK(for usable closedir return value, cl_cv_func_closedir_retval,[
37
#include <sys/types.h>
40
/* Declare opendir(), closedir(). */
41
#include <$ac_header_dirent>
42
int main() { exit(closedir(opendir(".")) != 0); }],
43
cl_cv_func_closedir_retval=yes, cl_cv_func_closedir_retval=no,
44
# When cross-compiling, don't assume a return value.
45
cl_cv_func_closedir_retval="guessing no")])
46
case "$cl_cv_func_closedir_retval" in
47
*no) AC_DEFINE(VOID_CLOSEDIR,,[closedir() return value is void or unusable]) ;;