diff options
| author | uwe <uwe@NetBSD.org> | 2006-01-27 01:53:13 +0000 |
|---|---|---|
| committer | uwe <uwe@NetBSD.org> | 2006-01-27 01:53:13 +0000 |
| commit | b04e9bed57f3a2db3168664b85e9a116aace4870 (patch) | |
| tree | 6764c3f150ae6db0372521aab7be80c2e70aea2b /sys/lib/libsa | |
| parent | 090e5961498072552f0f06e2616d9a5aac25da26 (diff) | |
Support 'z' (size_t) and 't' (ptrdiff_t) specifiers.
XXX: ptrdiff_t is only ever defined in <stddef.h> and is defined
unconditionally, without the ifndef dance. Until we have an expert
opinion, abuse intptr_t for the 't' size check.
Diffstat (limited to 'sys/lib/libsa')
| -rw-r--r-- | sys/lib/libsa/subr_prf.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/sys/lib/libsa/subr_prf.c b/sys/lib/libsa/subr_prf.c index 1d96b8ab96a..35dbb00450c 100644 --- a/sys/lib/libsa/subr_prf.c +++ b/sys/lib/libsa/subr_prf.c @@ -1,4 +1,4 @@ -/* $NetBSD: subr_prf.c,v 1.13 2005/12/11 12:24:46 christos Exp $ */ +/* $NetBSD: subr_prf.c,v 1.14 2006/01/27 01:53:13 uwe Exp $ */ /*- * Copyright (c) 1993 @@ -37,6 +37,7 @@ #include <sys/cdefs.h> #include <sys/types.h> +#include <sys/stdint.h> /* XXX: for intptr_t */ #include <machine/stdarg.h> #include "stand.h" @@ -95,6 +96,16 @@ reswitch: switch (ch = *fmt++) { case 'l': lflag = 1; goto reswitch; + case 't': +#if 0 /* XXX: abuse intptr_t until the situation with ptrdiff_t is clear */ + lflag = (sizeof(ptrdiff_t) == sizeof(long)); +#else + lflag = (sizeof(intptr_t) == sizeof(long)); +#endif + goto reswitch; + case 'z': + lflag = (sizeof(size_t) == sizeof(unsigned long)); + goto reswitch; case 'c': ch = va_arg(ap, int); put(ch & 0x7f); |
