From 371472d9fb6a936149b105a6563a0550d35bdf1a Mon Sep 17 00:00:00 2001 From: Manoj Srivastava Date: Mon, 1 Dec 2003 17:11:15 +0000 Subject: Initial import of upstream branch Initial import of upstream branch git-archimport-id: srivasta@debian.org--2003-primary/dist--upstream--3.70--base-0 --- mcon/U/d_vprintf.U | 80 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 mcon/U/d_vprintf.U (limited to 'mcon/U/d_vprintf.U') diff --git a/mcon/U/d_vprintf.U b/mcon/U/d_vprintf.U new file mode 100644 index 0000000..df02054 --- /dev/null +++ b/mcon/U/d_vprintf.U @@ -0,0 +1,80 @@ +?RCS: $Id: d_vprintf.U,v 3.0 1993/08/18 12:07:59 ram Exp $ +?RCS: +?RCS: Copyright (c) 1991-1993, Raphael Manfredi +?RCS: +?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: You may reuse parts of this distribution only within the terms of +?RCS: that same Artistic Licence; a copy of which may be found at the root +?RCS: of the source tree for dist 3.0. +?RCS: +?RCS: $Log: d_vprintf.U,v $ +?RCS: Revision 3.0 1993/08/18 12:07:59 ram +?RCS: Baseline for dist 3.0 netwide release. +?RCS: +?MAKE:d_vprintf d_charvspr: Guess cat +cc +ccflags Csym Setvar +?MAKE: -pick add $@ %< +?S:d_vprintf: +?S: This variable conditionally defines the HAS_VPRINTF symbol, which +?S: indicates to the C program that the vprintf() routine is available +?S: to printf with a pointer to an argument list. +?S:. +?S:d_charvspr: +?S: This variable conditionally defines CHARVSPRINTF if this system +?S: has vsprintf returning type (char*). The trend seems to be to +?S: declare it as "int vsprintf()". +?S:. +?C:HAS_VPRINTF (VPRINTF): +?C: This symbol, if defined, indicates that the vprintf routine is available +?C: to printf with a pointer to an argument list. If unavailable, you +?C: may need to write your own, probably in terms of _doprnt(). +?C:. +?C:USE_CHAR_VSPRINTF (CHARVSPRINTF): +?C: This symbol is defined if this system has vsprintf() returning type +?C: (char*). The trend seems to be to declare it as "int vsprintf()". It +?C: is up to the package author to declare vsprintf correctly based on the +?C: symbol. +?C:. +?H:#$d_vprintf HAS_VPRINTF /**/ +?H:#$d_charvspr USE_CHAR_VSPRINTF /**/ +?H:. +?T:val2 +?LINT:set d_vprintf d_charvspr +: see if vprintf exists +echo " " +if set vprintf val -f d_vprintf; eval $csym; $val; then + echo 'vprintf() found.' >&4 + val="$define" + $cat >vprintf.c <<'EOF' +#include + +main() { xxx("foo"); } + +xxx(va_alist) +va_dcl +{ + va_list args; + char buf[10]; + + va_start(args); + exit((unsigned long)vsprintf(buf,"%s",args) > 10L); +} +EOF + if $cc $ccflags vprintf.c -o vprintf >/dev/null 2>&1 && ./vprintf; then + echo "Your vsprintf() returns (int)." >&4 + val2="$undef" + else + echo "Your vsprintf() returns (char*)." >&4 + val2="$define" + fi +else + echo 'vprintf() NOT found.' >&4 + val="$undef" + val2="$undef" +fi +set d_vprintf +eval $setvar +val=$val2 +set d_charvspr +eval $setvar + -- cgit v1.2.3