__STDC__ is always defined on NetBSD.

This commit is contained in:
wiz 2002-05-26 14:43:59 +00:00
parent 94a6bb8164
commit 3fb28eec1f
11 changed files with 37 additions and 170 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: asprintf.c,v 1.10 2001/12/07 11:47:41 yamt Exp $ */
/* $NetBSD: asprintf.c,v 1.11 2002/05/26 14:43:59 wiz Exp $ */
/*
* Copyright (c) 1997 Todd C. Miller <Todd.Miller@courtesan.com>
@ -29,19 +29,15 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
__RCSID("$NetBSD: asprintf.c,v 1.10 2001/12/07 11:47:41 yamt Exp $");
__RCSID("$NetBSD: asprintf.c,v 1.11 2002/05/26 14:43:59 wiz Exp $");
#endif /* LIBC_SCCS and not lint */
#include "namespace.h"
#include <assert.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#if __STDC__
#include <stdarg.h>
#else
#include <varargs.h>
#endif
#include "local.h"
#ifdef __weak_alias
@ -49,14 +45,7 @@ __weak_alias(asprintf, _asprintf)
#endif
int
#if __STDC__
asprintf(char **str, char const *fmt, ...)
#else
asprintf(str, fmt, va_alist)
char **str;
const char *fmt;
va_dcl
#endif
{
int ret;
va_list ap;
@ -73,11 +62,7 @@ asprintf(str, fmt, va_alist)
if (f._bf._base == NULL)
goto err;
f._bf._size = f._w = 127; /* Leave room for the NUL */
#if __STDC__
va_start(ap, fmt);
#else
va_start(ap);
#endif
ret = vfprintf(&f, fmt, ap);
va_end(ap);
if (ret == -1)

View File

@ -1,4 +1,4 @@
/* $NetBSD: fprintf.c,v 1.8 1999/09/20 04:39:27 lukem Exp $ */
/* $NetBSD: fprintf.c,v 1.9 2002/05/26 14:43:59 wiz Exp $ */
/*-
* Copyright (c) 1990, 1993
@ -41,28 +41,17 @@
#if 0
static char sccsid[] = "@(#)fprintf.c 8.1 (Berkeley) 6/4/93";
#else
__RCSID("$NetBSD: fprintf.c,v 1.8 1999/09/20 04:39:27 lukem Exp $");
__RCSID("$NetBSD: fprintf.c,v 1.9 2002/05/26 14:43:59 wiz Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
#include <assert.h>
#include <errno.h>
#include <stdio.h>
#if __STDC__
#include <stdarg.h>
#else
#include <varargs.h>
#endif
#include <stdio.h>
int
#if __STDC__
fprintf(FILE *fp, const char *fmt, ...)
#else
fprintf(fp, fmt, va_alist)
FILE *fp;
char *fmt;
va_dcl
#endif
{
int ret;
va_list ap;
@ -70,11 +59,7 @@ fprintf(fp, fmt, va_alist)
_DIAGASSERT(fp != NULL);
_DIAGASSERT(fmt != NULL);
#if __STDC__
va_start(ap, fmt);
#else
va_start(ap);
#endif
ret = vfprintf(fp, fmt, ap);
va_end(ap);
return (ret);

View File

@ -1,4 +1,4 @@
/* $NetBSD: fscanf.c,v 1.9 2002/05/24 22:17:20 thorpej Exp $ */
/* $NetBSD: fscanf.c,v 1.10 2002/05/26 14:43:59 wiz Exp $ */
/*-
* Copyright (c) 1990, 1993
@ -41,42 +41,24 @@
#if 0
static char sccsid[] = "@(#)fscanf.c 8.1 (Berkeley) 6/4/93";
#else
__RCSID("$NetBSD: fscanf.c,v 1.9 2002/05/24 22:17:20 thorpej Exp $");
__RCSID("$NetBSD: fscanf.c,v 1.10 2002/05/26 14:43:59 wiz Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
#include <assert.h>
#include <errno.h>
#include <stdio.h>
#if __STDC__
#include <stdarg.h>
#else
#include <varargs.h>
#endif
#include <stdio.h>
#include "local.h"
int
#if __STDC__
fscanf(FILE *fp, char const *fmt, ...) {
int ret;
va_list ap;
va_start(ap, fmt);
#else
fscanf(fp, fmt, va_alist)
FILE *fp;
char *fmt;
va_dcl
fscanf(FILE *fp, char const *fmt, ...)
{
int ret;
va_list ap;
_DIAGASSERT(fp != NULL);
_DIAGASSERT(fmt != NULL);
va_start(ap);
#endif
va_start(ap, fmt);
ret = __svfscanf(fp, fmt, ap);
va_end(ap);
return (ret);

View File

@ -1,4 +1,4 @@
/* $NetBSD: fvwrite.h,v 1.4 1998/09/08 15:10:12 kleink Exp $ */
/* $NetBSD: fvwrite.h,v 1.5 2002/05/26 14:43:59 wiz Exp $ */
/*-
* Copyright (c) 1990, 1993
@ -51,8 +51,4 @@ struct __suio {
int uio_resid;
};
#if __STDC__ || __cplusplus
extern int __sfvwrite(FILE *, struct __suio *);
#else
extern int __sfvwrite();
#endif

View File

@ -1,4 +1,4 @@
/* $NetBSD: printf.c,v 1.8 1999/09/20 04:39:31 lukem Exp $ */
/* $NetBSD: printf.c,v 1.9 2002/05/26 14:43:59 wiz Exp $ */
/*-
* Copyright (c) 1990, 1993
@ -41,37 +41,22 @@
#if 0
static char sccsid[] = "@(#)printf.c 8.1 (Berkeley) 6/4/93";
#else
__RCSID("$NetBSD: printf.c,v 1.8 1999/09/20 04:39:31 lukem Exp $");
__RCSID("$NetBSD: printf.c,v 1.9 2002/05/26 14:43:59 wiz Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
#include <assert.h>
#include <errno.h>
#include <stdio.h>
#if __STDC__
#include <stdarg.h>
#else
#include <varargs.h>
#endif
#include <stdio.h>
int
#if __STDC__
printf(char const *fmt, ...)
#else
printf(fmt, va_alist)
char *fmt;
va_dcl
#endif
{
int ret;
va_list ap;
#if __STDC__
va_start(ap, fmt);
#else
va_start(ap);
#endif
ret = vfprintf(stdout, fmt, ap);
va_end(ap);
return (ret);

View File

@ -1,4 +1,4 @@
/* $NetBSD: scanf.c,v 1.9 2002/05/24 22:17:20 thorpej Exp $ */
/* $NetBSD: scanf.c,v 1.10 2002/05/26 14:44:00 wiz Exp $ */
/*-
* Copyright (c) 1990, 1993
@ -41,40 +41,26 @@
#if 0
static char sccsid[] = "@(#)scanf.c 8.1 (Berkeley) 6/4/93";
#else
__RCSID("$NetBSD: scanf.c,v 1.9 2002/05/24 22:17:20 thorpej Exp $");
__RCSID("$NetBSD: scanf.c,v 1.10 2002/05/26 14:44:00 wiz Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
#include <assert.h>
#include <errno.h>
#include <stdio.h>
#if __STDC__
#include <stdarg.h>
#else
#include <varargs.h>
#endif
#include <stdio.h>
#include "local.h"
int
#if __STDC__
scanf(char const *fmt, ...)
#else
scanf(fmt, va_alist)
char *fmt;
va_dcl
#endif
{
int ret;
va_list ap;
_DIAGASSERT(fmt != NULL);
#if __STDC__
va_start(ap, fmt);
#else
va_start(ap);
#endif
ret = __svfscanf(stdin, fmt, ap);
va_end(ap);
return (ret);

View File

@ -1,4 +1,4 @@
/* $NetBSD: snprintf.c,v 1.15 2001/12/07 11:47:43 yamt Exp $ */
/* $NetBSD: snprintf.c,v 1.16 2002/05/26 14:44:00 wiz Exp $ */
/*-
* Copyright (c) 1990, 1993
@ -41,7 +41,7 @@
#if 0
static char sccsid[] = "@(#)snprintf.c 8.1 (Berkeley) 6/4/93";
#else
__RCSID("$NetBSD: snprintf.c,v 1.15 2001/12/07 11:47:43 yamt Exp $");
__RCSID("$NetBSD: snprintf.c,v 1.16 2002/05/26 14:44:00 wiz Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
@ -49,12 +49,9 @@ __RCSID("$NetBSD: snprintf.c,v 1.15 2001/12/07 11:47:43 yamt Exp $");
#include <assert.h>
#include <errno.h>
#include <stdio.h>
#if __STDC__
#include <stdarg.h>
#else
#include <varargs.h>
#endif
#include <stdio.h>
#include "local.h"
#ifdef __weak_alias
@ -62,15 +59,7 @@ __weak_alias(snprintf,_snprintf)
#endif
int
#if __STDC__
snprintf(char *str, size_t n, char const *fmt, ...)
#else
snprintf(str, n, fmt, va_alist)
char *str;
size_t n;
char *fmt;
va_dcl
#endif
{
int ret;
va_list ap;
@ -84,11 +73,7 @@ snprintf(str, n, fmt, va_alist)
errno = EINVAL;
return (-1);
}
#if __STDC__
va_start(ap, fmt);
#else
va_start(ap);
#endif
_FILEEXT_SETUP(&f, &fext);
f._file = -1;
f._flags = __SWR | __SSTR;

View File

@ -1,4 +1,4 @@
/* $NetBSD: sprintf.c,v 1.10 2001/12/07 11:47:44 yamt Exp $ */
/* $NetBSD: sprintf.c,v 1.11 2002/05/26 14:44:00 wiz Exp $ */
/*-
* Copyright (c) 1990, 1993
@ -41,30 +41,20 @@
#if 0
static char sccsid[] = "@(#)sprintf.c 8.1 (Berkeley) 6/4/93";
#else
__RCSID("$NetBSD: sprintf.c,v 1.10 2001/12/07 11:47:44 yamt Exp $");
__RCSID("$NetBSD: sprintf.c,v 1.11 2002/05/26 14:44:00 wiz Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
#include <assert.h>
#include <errno.h>
#include <stdio.h>
#if __STDC__
#include <stdarg.h>
#else
#include <varargs.h>
#endif
#include <limits.h>
#include <stdarg.h>
#include <stdio.h>
#include "local.h"
int
#if __STDC__
sprintf(char *str, char const *fmt, ...)
#else
sprintf(str, fmt, va_alist)
char *str;
char *fmt;
va_dcl
#endif
{
int ret;
va_list ap;
@ -79,11 +69,7 @@ sprintf(str, fmt, va_alist)
f._flags = __SWR | __SSTR;
f._bf._base = f._p = (unsigned char *)str;
f._bf._size = f._w = INT_MAX;
#if __STDC__
va_start(ap, fmt);
#else
va_start(ap);
#endif
ret = vfprintf(&f, fmt, ap);
va_end(ap);
*f._p = 0;

View File

@ -1,4 +1,4 @@
/* $NetBSD: sscanf.c,v 1.12 2001/12/07 11:47:44 yamt Exp $ */
/* $NetBSD: sscanf.c,v 1.13 2002/05/26 14:44:00 wiz Exp $ */
/*-
* Copyright (c) 1990, 1993
@ -41,19 +41,16 @@
#if 0
static char sccsid[] = "@(#)sscanf.c 8.1 (Berkeley) 6/4/93";
#else
__RCSID("$NetBSD: sscanf.c,v 1.12 2001/12/07 11:47:44 yamt Exp $");
__RCSID("$NetBSD: sscanf.c,v 1.13 2002/05/26 14:44:00 wiz Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
#include <assert.h>
#include <errno.h>
#include <stdarg.h>
#include <stdio.h>
#include <string.h>
#if __STDC__
#include <stdarg.h>
#else
#include <varargs.h>
#endif
#include "local.h"
static int eofread __P((void *, char *, int));
@ -70,14 +67,7 @@ eofread(cookie, buf, len)
}
int
#if __STDC__
sscanf(const char *str, char const *fmt, ...)
#else
sscanf(str, fmt, va_alist)
const char *str;
char *fmt;
va_dcl
#endif
{
int ret;
va_list ap;
@ -95,11 +85,7 @@ sscanf(str, fmt, va_alist)
f._read = eofread;
_UB(&f)._base = NULL;
f._lb._base = NULL;
#if __STDC__
va_start(ap, fmt);
#else
va_start(ap);
#endif
ret = __svfscanf(&f, fmt, ap);
va_end(ap);
return (ret);

View File

@ -1,4 +1,4 @@
/* $NetBSD: vfprintf.c,v 1.42 2001/12/07 11:47:44 yamt Exp $ */
/* $NetBSD: vfprintf.c,v 1.43 2002/05/26 14:44:00 wiz Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@ -41,7 +41,7 @@
#if 0
static char *sccsid = "@(#)vfprintf.c 5.50 (Berkeley) 12/16/92";
#else
__RCSID("$NetBSD: vfprintf.c,v 1.42 2001/12/07 11:47:44 yamt Exp $");
__RCSID("$NetBSD: vfprintf.c,v 1.43 2002/05/26 14:44:00 wiz Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
@ -56,6 +56,7 @@ __RCSID("$NetBSD: vfprintf.c,v 1.42 2001/12/07 11:47:44 yamt Exp $");
#include <assert.h>
#include <errno.h>
#include <stdarg.h>
#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
@ -63,12 +64,6 @@ __RCSID("$NetBSD: vfprintf.c,v 1.42 2001/12/07 11:47:44 yamt Exp $");
#include <string.h>
#include <wchar.h>
#if __STDC__
#include <stdarg.h>
#else
#include <varargs.h>
#endif
#include "local.h"
#include "fvwrite.h"
#include "extern.h"

View File

@ -1,4 +1,4 @@
/* $NetBSD: vfscanf.c,v 1.31 2002/05/24 22:17:20 thorpej Exp $ */
/* $NetBSD: vfscanf.c,v 1.32 2002/05/26 14:44:00 wiz Exp $ */
/*-
* Copyright (c) 1990, 1993
@ -41,7 +41,7 @@
#if 0
static char sccsid[] = "@(#)vfscanf.c 8.1 (Berkeley) 6/4/93";
#else
__RCSID("$NetBSD: vfscanf.c,v 1.31 2002/05/24 22:17:20 thorpej Exp $");
__RCSID("$NetBSD: vfscanf.c,v 1.32 2002/05/26 14:44:00 wiz Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
@ -50,15 +50,11 @@ __RCSID("$NetBSD: vfscanf.c,v 1.31 2002/05/24 22:17:20 thorpej Exp $");
#include <assert.h>
#include <errno.h>
#include <inttypes.h>
#include <stdarg.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#if __STDC__
#include <stdarg.h>
#else
#include <varargs.h>
#endif
#include "local.h"
#include "reentrant.h"