?RCS: $Id: d_brokstat.U 1 2006-08-24 12:32:52Z rmanfredi $
?RCS:
?RCS: Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi
?RCS:
?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 4.0.
?RCS:
?RCS: $Log: d_brokstat.U,v $
?RCS: Revision 3.0.1.1  1997/02/28  15:30:53  ram
?RCS: patch61: created
?RCS:
?MAKE:d_brokstat: cat contains cppstdin cppminus +cppflags rm Setvar
?MAKE:	-pick add $@ %<
?S:d_brokstat:
?S:	This variable conditionally defines STAT_MACROS_BROKEN if some
?S:	of the S_IS*() macros from <sys/stat.h> give false positive on
?S:	regular files.
?S:.
?C:STAT_MACROS_BROKEN:
?C:	This symbol, if defined, indicates that the S_IS*() stat macros
?C:	such as S_ISBLK() give false positive and are thus unusable.
?C:	Your best bet is then to supply your own set.
?C:.
?H:#$d_brokstat STAT_MACROS_BROKEN 	/**/
?H:.
?F:!try.c !try
?LINT:set d_brokstat
?LINT:usefile try
?X: This test inspired by autoconf -- RAM, 28/02/97
: are stat macros sane?
echo " "
echo "Checking whether your stat() macros are broken..."
$cat >try.c <<'EOC'
#include <sys/types.h>
#include <sys/stat.h>

#if defined(S_ISBLK) && defined(S_IFDIR)
#if S_ISBLK(S_IFDIR)
Broken
#endif
#endif

#if defined(S_ISBLK) && defined(S_IFCHR)
#if S_ISBLK(S_IFCHR)
Broken
#endif
#endif

#if defined(S_ISLNK) && defined(S_IFREG)
#if S_ISLNK(S_IFREG)
Broken.
#endif
#endif

#if defined(S_ISSOCK) && defined(S_IFREG)
#if S_ISSOCK(S_IFREG)
Broken.
#endif
#endif
EOC
$cppstdin $cppflags $cppminus <try.c 2>/dev/null >try
if $contains Broken try >/dev/null 2>&1; then
	echo "Alas, they are.  I'll use my own macro set then." >&4
	val="$define"
else
	echo "Nope, working just fine." >&4
	val="$undef"
fi
$rm -f try try.c
set d_brokstat
eval $setvar

