?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:
?MAKE:i_stdckdint: Setvar cat Compile rm_try
?MAKE:	-pick add $@ %<
?S:i_stdckdint:
?S:	This variable conditionally defines the I_STDCKDINT symbol, which
?S:	indicates to the C program that <stdckdint.h> exists and should
?S:	be included.
?S:.
?C:I_STDCKDINT:
?C:	This symbol, if defined, indicates that <stdckdint.h> exists and
?C:	can be included.
?C:.
?H:#$i_stdckdint I_STDCKDINT		/**/
?H:.
?LINT:set i_stdckdint
: see if C23 stdckdint is available
: we want a real compile instead of Inhdr because some FreeBSD systems
: have stdckdint.h, but it is not compatible with C++.
case "$i_stdckdint" in
'')
    echo " "
    $cat >try.c <<EOCP
#include <stdio.h>
#include <stdckdint.h>
int func(long *resultptr, long a, long b)
{
    return (ckd_add(resultptr, a, b) ||
	    ckd_sub(resultptr, a, b) ||
	    ckd_mul(resultptr, a, b)) ? 1 : 0;
}
int main(int argc, char **argv)
{
    long result;
    return func(&result, 42L, 53L);
}
EOCP
    set try
    if eval $compile; then
	echo "<stdckdint.h> found." >&4
	val="$define"
    else
	echo "<stdckdint.h> NOT found." >&4
	val="$undef"
    fi ;;
*)
    val="$i_stdckdint" ;;
esac

$rm_try
set i_stdckdint
eval $setvar

