3 ?RCS: Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi
5 ?RCS: You may redistribute only under the terms of the Artistic License,
6 ?RCS: as specified in the README file that comes with the distribution.
7 ?RCS: You may reuse parts of this distribution only within the terms of
8 ?RCS: that same Artistic License; a copy of which may be found at the root
9 ?RCS: of the source tree for dist 4.0.
11 ?RCS: Original Author: Andy Dougherty <doughera@lafcol.lafayette.edu>
13 ?RCS: $Log: d_closedir.U,v $
14 ?RCS: Revision 3.0.1.3 1997/02/28 15:31:26 ram
15 ?RCS: patch61: added ?F: metalint hint
17 ?RCS: Revision 3.0.1.2 1994/10/29 16:11:18 ram
18 ?RCS: patch36: added 'ldflags' to the test compile line (ADO)
20 ?RCS: Revision 3.0.1.1 1994/08/29 16:07:21 ram
21 ?RCS: patch32: created by ADO
23 ?MAKE:d_closedir d_void_closedir: Inlibc i_dirent i_sysdir i_sysndir \
24 cc ccflags ldflags libs Setvar rm
25 ?MAKE: -pick add $@ %<
27 ?S: This variable conditionally defines HAS_CLOSEDIR if closedir() is
31 ?C: This symbol, if defined, indicates that the closedir() routine is
34 ?H:#$d_closedir HAS_CLOSEDIR /**/
37 ?S: This variable conditionally defines VOID_CLOSEDIR if closedir()
38 ?S: does not return a value.
41 ?C: This symbol, if defined, indicates that the closedir() routine
42 ?C: does not return a value.
44 ?H:#$d_void_closedir VOID_CLOSEDIR /**/
47 ?LINT:set d_closedir d_void_closedir
48 : see if closedir exists
49 set closedir d_closedir
52 @if VOID_CLOSEDIR || d_void_closedir
53 ?X: The following contortions are designed so we can call closedir()
54 ?X: and check whether it returns a value. The contortions are designed
55 ?X: to portably pick up the correct directory header, for those
56 ?X: systems that support various mutually incompatible directory functions.
57 ?X: This is from perl5's perl.h
61 echo "Checking whether closedir() returns a status..." >&4
62 cat > closedir.c <<EOM
63 #$i_dirent I_DIRENT /**/
64 #$i_sysdir I_SYS_DIR /**/
65 #$i_sysndir I_SYS_NDIR /**/
69 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
78 #include <ndir.h> /* may be wrong in the future */
85 int main() { return closedir(opendir(".")); }
87 if $cc $ccflags $ldflags -o closedir closedir.c $libs > /dev/null 2>&1; then
88 if ./closedir > /dev/null 2>&1 ; then
92 echo "No, it doesn't."
96 echo "(I can't seem to compile the test program--assuming it doesn't)"