:
#
# Copyright 1996 Brent Townshend (bst@tc.com)
# Townshend Computer Tools
# Montreal, Quebec
#
# Check if a symbol is defined as an inline function in system headers.
# Usage: checkinline symbol [headers]
# Returns non-zero exit status if not defined.
# CC, CCFLAGS, and DEFHEADERS must be defined before calling.
# Reads from syscap.new
# Appends to 'SysConfig.errs' and 'syscap.new'
echo $0 $*  >>SysConfig.errs
tmp=checkinline$$
symbol=$1
shift
{	
    for i in $DEFHEADERS $*
    do
	grep -s "MISSING_`echo $i|tr './' '__'`" syscap.new >/dev/null || echo '#include <'$i'>'
    done
    echo "extern struct { int x;float y; } $symbol();"
    echo 'main() { ; }'
} > ${tmp}.c
if $CC $CCFLAGS -c ${tmp}.c >>SysConfig.errs 2>&1
then
    rm -f ${tmp}.*
    exit 1
else
    # It is defined as an inline
    rm -f ${tmp}.*
    echo $n "$symbol+...$c"
    echo "#define HAS_$symbol" >> syscap.new
    echo "#define ISINLINE_$symbol" >>syscap.new
    exit 0
fi
