This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Add the files from dist/meta to perl's repo
[metaconfig.git] / dist / U / d_charsprf.U
CommitLineData
d8875586
MBT
1?RCS: $Id: d_charsprf.U 1 2006-08-24 12:32:52Z rmanfredi $
2?RCS:
3?RCS: Copyright (c) 1991-1997, 2004-2006, 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 4.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?F:!ucbsprf.c !ucbsprf
31?LINT:set d_charsprf
32: see if sprintf is declared as int or pointer to char
33echo " "
34$cat >ucbsprf.c <<'EOF'
35int main()
36{
37 int sprintf();
38 char buf[10];
39 exit((unsigned long)sprintf(buf,"%s","foo") > 10L);
40}
41EOF
42if $cc -o ucbsprf ucbsprf.c >/dev/null 2>&1 && ./ucbsprf; then
43 echo "Your sprintf() returns (int)." >&4
44 val="$undef"
45else
46 echo "Your sprintf() returns (char*)." >&4
47 val="$define"
48fi
49set d_charsprf
50eval $setvar
51$rm -f ucbsprf*
52