This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Metaconfig documentation update (part 2)
[metaconfig.git] / dist-3.0at70b / mcon / U / d_vprintf.U
1 ?RCS: $Id: d_vprintf.U,v 3.0 1993/08/18 12:07:59 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_vprintf.U,v $
12 ?RCS: Revision 3.0  1993/08/18  12:07:59  ram
13 ?RCS: Baseline for dist 3.0 netwide release.
14 ?RCS:
15 ?MAKE:d_vprintf d_charvspr: Guess cat +cc +ccflags Csym Setvar
16 ?MAKE:  -pick add $@ %<
17 ?S:d_vprintf:
18 ?S:     This variable conditionally defines the HAS_VPRINTF symbol, which
19 ?S:     indicates to the C program that the vprintf() routine is available
20 ?S:     to printf with a pointer to an argument list.
21 ?S:.
22 ?S:d_charvspr:
23 ?S:     This variable conditionally defines CHARVSPRINTF if this system
24 ?S:     has vsprintf returning type (char*).  The trend seems to be to
25 ?S:     declare it as "int vsprintf()".
26 ?S:.
27 ?C:HAS_VPRINTF (VPRINTF):
28 ?C:     This symbol, if defined, indicates that the vprintf routine is available
29 ?C:     to printf with a pointer to an argument list.  If unavailable, you
30 ?C:     may need to write your own, probably in terms of _doprnt().
31 ?C:.
32 ?C:USE_CHAR_VSPRINTF (CHARVSPRINTF):
33 ?C:     This symbol is defined if this system has vsprintf() returning type
34 ?C:     (char*).  The trend seems to be to declare it as "int vsprintf()".  It
35 ?C:     is up to the package author to declare vsprintf correctly based on the
36 ?C:     symbol.
37 ?C:.
38 ?H:#$d_vprintf HAS_VPRINTF      /**/
39 ?H:#$d_charvspr USE_CHAR_VSPRINTF       /**/
40 ?H:.
41 ?T:val2
42 ?LINT:set d_vprintf d_charvspr
43 : see if vprintf exists
44 echo " "
45 if set vprintf val -f d_vprintf; eval $csym; $val; then
46         echo 'vprintf() found.' >&4
47         val="$define"
48         $cat >vprintf.c <<'EOF'
49 #include <varargs.h>
50
51 int main() { xxx("foo"); }
52
53 xxx(va_alist)
54 va_dcl
55 {
56         va_list args;
57         char buf[10];
58
59         va_start(args);
60         exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
61 }
62 EOF
63         if $cc $ccflags -o vprintf vprintf.c >/dev/null 2>&1 && ./vprintf; then
64                 echo "Your vsprintf() returns (int)." >&4
65                 val2="$undef"
66         else
67                 echo "Your vsprintf() returns (char*)." >&4
68                 val2="$define"
69         fi
70 else
71         echo 'vprintf() NOT found.' >&4
72                 val="$undef"
73                 val2="$undef"
74 fi
75 set d_vprintf
76 eval $setvar
77 val=$val2
78 set d_charvspr
79 eval $setvar
80