This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Populate metaconfig branch.
[metaconfig.git] / dist-3.0at70b / mcon / U / d_charsprf.U
1 ?RCS: $Id: d_charsprf.U,v 3.0 1993/08/18 12:05:49 ram Exp $
2 ?RCS:
3 ?RCS: Copyright (c) 1991-1993, Raphael Manfredi
4 ?RCS: 
5 ?RCS: You may redistribute only under the terms of the Artistic Licence,
6 ?RCS: as specified in the README file that comes with the distribution.
7 ?RCS: You may reuse parts of this distribution only within the terms of
8 ?RCS: that same Artistic Licence; a copy of which may be found at the root
9 ?RCS: of the source tree for dist 3.0.
10 ?RCS:
11 ?RCS: $Log: d_charsprf.U,v $
12 ?RCS: Revision 3.0  1993/08/18  12:05:49  ram
13 ?RCS: Baseline for dist 3.0 netwide release.
14 ?RCS:
15 ?MAKE:d_charsprf: cat rm +cc Setvar
16 ?MAKE:  -pick add $@ %<
17 ?S:d_charsprf:
18 ?S:     This variable conditionally defines CHARSPRINTF if this system
19 ?S:     declares "char *sprintf()" in stdio.h.  The trend seems to be to
20 ?S:     declare it as "int sprintf()".
21 ?S:.
22 ?C:CHARSPRINTF:
23 ?C:     This symbol is defined if this system declares "char *sprintf()" in
24 ?C:     stdio.h.  The trend seems to be to declare it as "int sprintf()".  It
25 ?C:     is up to the package author to declare sprintf correctly based on the
26 ?C:     symbol.
27 ?C:.
28 ?H:#$d_charsprf CHARSPRINTF     /**/
29 ?H:.
30 ?LINT:set d_charsprf
31 : see if sprintf is declared as int or pointer to char
32 echo " "
33 $cat >ucbsprf.c <<'EOF'
34 main()
35 {
36         int sprintf();
37         char buf[10];
38         exit((unsigned long)sprintf(buf,"%s","foo") > 10L);
39 }
40 EOF
41 if $cc -o ucbsprf ucbsprf.c >/dev/null 2>&1 && ./ucbsprf; then
42         echo "Your sprintf() returns (int)." >&4
43         val="$undef"
44 else
45         echo "Your sprintf() returns (char*)." >&4
46         val="$define"
47 fi
48 set d_charsprf
49 eval $setvar
50 $rm -f ucbsprf*
51