?RCS: $Id: d_closedir.U,v 3.0.1.3 1997/02/28 15:31:26 ram Exp $ ?RCS: ?RCS: Copyright (c) 1991-1993, Raphael Manfredi ?RCS: ?RCS: You may redistribute only under the terms of the Artistic License, ?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 License; a copy of which may be found at the root ?RCS: of the source tree for dist 3.0. ?RCS: ?RCS: Original Author: Andy Dougherty ?RCS: ?RCS: $Log: d_closedir.U,v $ ?RCS: Revision 3.0.1.3 1997/02/28 15:31:26 ram ?RCS: patch61: added ?F: metalint hint ?RCS: ?RCS: Revision 3.0.1.2 1994/10/29 16:11:18 ram ?RCS: patch36: added 'ldflags' to the test compile line (ADO) ?RCS: ?RCS: Revision 3.0.1.1 1994/08/29 16:07:21 ram ?RCS: patch32: created by ADO ?RCS: ?MAKE:d_closedir d_void_closedir: Inlibc i_dirent i_sysdir i_sysndir \ i_systypes Compile Setvar rm_try run ?MAKE: -pick add $@ %< ?S:d_closedir: ?S: This variable conditionally defines HAS_CLOSEDIR if closedir() is ?S: available. ?S:. ?C:HAS_CLOSEDIR: ?C: This symbol, if defined, indicates that the closedir() routine is ?C: available. ?C:. ?H:#$d_closedir HAS_CLOSEDIR /**/ ?H:. ?S:d_void_closedir: ?S: This variable conditionally defines VOID_CLOSEDIR if closedir() ?S: does not return a value. ?S:. ?C:VOID_CLOSEDIR: ?C: This symbol, if defined, indicates that the closedir() routine ?C: does not return a value. ?C:. ?H:#$d_void_closedir VOID_CLOSEDIR /**/ ?H:. ?F:!try ?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 "$define") echo " " echo "Checking whether closedir() returns a status..." >&4 cat > try.c < #endif #if defined(I_DIRENT) #include #else #ifdef I_SYS_NDIR #include #else #ifdef I_SYS_DIR #include #endif #endif #endif int main() { return closedir(opendir(".")); } EOM set try if eval $compile_ok; then if $run ./try > /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"; ;; esac set d_void_closedir eval $setvar $rm_try @end