1 ?RCS: $Id: d_closedir.U,v 3.0.1.3 1997/02/28 15:31:26 ram Exp $
3 ?RCS: Copyright (c) 1991-1993, Raphael Manfredi
5 ?RCS: You may redistribute only under the terms of the Artistic Licence,
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 Licence; a copy of which may be found at the root
9 ?RCS: of the source tree for dist 3.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 i_systypes Compile Setvar rm_try run
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 /**/
46 ?LINT:set d_closedir d_void_closedir
47 : see if closedir exists
48 set closedir d_closedir
51 @if VOID_CLOSEDIR || d_void_closedir
52 ?X: The following contortions are designed so we can call closedir()
53 ?X: and check whether it returns a value. The contortions are designed
54 ?X: to portably pick up the correct directory header, for those
55 ?X: systems that support various mutually incompatible directory functions.
56 ?X: This is from perl5's perl.h
60 echo "Checking whether closedir() returns a status..." >&4
62 #$i_dirent I_DIRENT /**/
63 #$i_sysdir I_SYS_DIR /**/
64 #$i_sysndir I_SYS_NDIR /**/
65 #$i_systypes I_SYS_TYPES /**/
67 #if defined(I_SYS_TYPES)
68 #include <sys/types.h>
72 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
81 #include <ndir.h> /* may be wrong in the future */
88 int main() { return closedir(opendir(".")); }
91 if eval $compile_ok; then
92 if $run ./try > /dev/null 2>&1 ; then
96 echo "No, it doesn't."
100 echo "(I can't seem to compile the test program--assuming it doesn't)"