~ubuntu-branches/debian/squeeze/ffcall/squeeze

« back to all changes in this revision

Viewing changes to src/m4/closedir.m4

  • Committer: Bazaar Package Importer
  • Author(s): Christoph Egger
  • Date: 2010-06-26 15:29:30 UTC
  • mfrom: (5.1.1 experimental)
  • Revision ID: james.westby@ubuntu.com-20100626152930-c09y01gk3szcnykn
Tags: 1.10+cvs20100619-2
Ship to unstable

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
dnl -*- Autoconf -*-
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.
8
 
 
9
 
dnl From Bruno Haible, Marcus Daniels, Sam Steingold.
10
 
 
11
 
AC_PREREQ(2.13)
12
 
 
13
 
AC_DEFUN([CL_CLOSEDIR],
14
 
[AC_REQUIRE([CL_DIR_HEADER])dnl
15
 
AC_BEFORE([$0], [CL_FILECHARSET])dnl
16
 
CL_PROTO([closedir], [
17
 
CL_PROTO_RET([
18
 
#include <stdlib.h>
19
 
#ifdef HAVE_UNISTD_H
20
 
#include <sys/types.h>
21
 
#include <unistd.h>
22
 
#endif
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])
30
 
else
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,[
34
 
AC_TRY_RUN([
35
 
#include <stdlib.h>
36
 
#ifdef HAVE_UNISTD_H
37
 
#include <sys/types.h>
38
 
#include <unistd.h>
39
 
#endif
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]) ;;
48
 
esac
49
 
fi
50
 
])