path: root/mcon/U/d_closedir.U
diff options
Diffstat (limited to 'mcon/U/d_closedir.U')
1 files changed, 107 insertions, 0 deletions
diff --git a/mcon/U/d_closedir.U b/mcon/U/d_closedir.U
new file mode 100644
index 0000000..94f02ad
--- /dev/null
+++ b/mcon/U/d_closedir.U
@@ -0,0 +1,107 @@
+?RCS: $Id: d_closedir.U,v 1997/02/28 15:31:26 ram Exp $
+?RCS: Copyright (c) 1991-1993, Raphael Manfredi
+?RCS: You may redistribute only under the terms of the Artistic Licence,
+?RCS: as specified in the README file that comes with the distribution.
+?RCS: You may reuse parts of this distribution only within the terms of
+?RCS: that same Artistic Licence; a copy of which may be found at the root
+?RCS: of the source tree for dist 3.0.
+?RCS: Original Author: Andy Dougherty <>
+?RCS: $Log: d_closedir.U,v $
+?RCS: Revision 1997/02/28 15:31:26 ram
+?RCS: patch61: added ?F: metalint hint
+?RCS: Revision 1994/10/29 16:11:18 ram
+?RCS: patch36: added 'ldflags' to the test compile line (ADO)
+?RCS: Revision 1994/08/29 16:07:21 ram
+?RCS: patch32: created by ADO
+?MAKE:d_closedir d_void_closedir: Inlibc i_dirent i_sysdir i_sysndir \
+ cc ccflags ldflags libs Setvar rm
+?MAKE: -pick add $@ %<
+?S: This variable conditionally defines HAS_CLOSEDIR if closedir() is
+?S: available.
+?C: This symbol, if defined, indicates that the closedir() routine is
+?C: available.
+?H:#$d_closedir HAS_CLOSEDIR /**/
+?S: This variable conditionally defines VOID_CLOSEDIR if closedir()
+?S: does not return a value.
+?C: This symbol, if defined, indicates that the closedir() routine
+?C: does not return a value.
+?H:#$d_void_closedir VOID_CLOSEDIR /**/
+?LINT:set d_closedir d_void_closedir
+: see if closedir exists
+set closedir d_closedir
+eval $inlibc
+@if VOID_CLOSEDIR || d_void_closedir
+?X: The following contortions are designed so we can call closedir()
+?X: and check whether it returns a value. The contortions are designed
+?X: to portably pick up the correct directory header, for those
+?X: systems that support various mutually incompatible directory functions.
+?X: This is from perl5's perl.h
+case "$d_closedir" in
+ echo " "
+ echo "Checking whether closedir() returns a status..." >&4
+ cat > closedir.c <<EOM
+#$i_dirent I_DIRENT /**/
+#$i_sysdir I_SYS_DIR /**/
+#$i_sysndir I_SYS_NDIR /**/
+#if defined(I_DIRENT)
+#include <dirent.h>
+#if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
+#include <sys/dir.h>
+#ifdef I_SYS_NDIR
+#include <sys/ndir.h>
+#ifdef I_SYS_DIR
+#ifdef hp9000s500
+#include <ndir.h> /* may be wrong in the future */
+#include <sys/dir.h>
+int main() { return closedir(opendir(".")); }
+ if $cc $ccflags $ldflags -o closedir closedir.c $libs > /dev/null 2>&1; then
+ if ./closedir > /dev/null 2>&1 ; then
+ echo "Yes, it does."
+ val="$undef"
+ else
+ echo "No, it doesn't."
+ val="$define"
+ fi
+ else
+ echo "(I can't seem to compile the test program--assuming it doesn't)"
+ val="$define"
+ fi
+ ;;
+ val="$undef";
+ ;;
+set d_void_closedir
+eval $setvar
+$rm -f closedir*