diff --git a/ChangeLog b/ChangeLog index b0cb793adb..09318fc9fd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,44 @@ +2000-09-13 Ulrich Drepper + + * libio/stdio.h: Define __FILE if __need___FILE is defined. + * stdio/stdio.h: Likewise. + * wcsmbs/wchar.h: Get definition of __FILE. Use __FILE instead of FILE. + * include/stdio.h: Handle __need___FILE like __need_FILE. + * include/wchar.h: Use __FILE instead of FILE. + * libio/fwprintf.c: Include for FILE definition. + * libio/fwscanf.c: Likewise. + * libio/getwc.c: Likewise. + + * sysdeps/generic/stdint.h (WINT_MAX): Define to 4294967295u. + * sysdeps/generic/bits/wchar.h (WCHAR_MIN): Define to -2147483647 - 1. + * sysdeps/unix/sysv/linux/i386/bits/wchar.h: Likewise. + + * assert/assert.h: Update comment header about ISO C section. + * math/complex.h: Likewise. + * ctype/ctype.h: Likewise. + * include/errno.h: Likewise. + * include/limits.h: Likewise. + * locale/locale.h: Likewise. + * math/math.h: Likewise. + * setjmp/setjmp.h: Likewise. + * signal/signal.h: Likewise. + * stdio/stdio.h: Likewise. + * libio/stdio.h: Likewise. + * stdlib/stdlib.h: Likewise. + * string/string.h: Likewise. + * time/time.h: Likewise. + * wcsmbs/wchar.h: Likewise. + * wctype/wctype.h: Likewise. + Patches by Joseph S. Myers . + +2000-09-13 Andreas Jaeger + + * sysdeps/unix/sysv/linux/bits/socket.h (__cmsg_nxthdr): Fix test + for no more entries. + * sysdeps/unix/sysv/aix/bits/socket.h (__cmsg_nxthdr): Likewise. + * sysdeps/unix/sysv/linux/mips/bits/socket.h (__cmsg_nxthdr): Likewise. + Reported by Eric S. Johnson , closes PR libc/1887. + 2000-09-13 Ulrich Drepper * sysdeps/unix/sysv/linux/bits/time.h (CLOCKS_PER_SEC): Make a long int diff --git a/assert/assert.h b/assert/assert.h index b24696211f..15c5d05d3d 100644 --- a/assert/assert.h +++ b/assert/assert.h @@ -17,7 +17,7 @@ Boston, MA 02111-1307, USA. */ /* - * ISO C Standard: 4.2 DIAGNOSTICS + * ISO C99 Standard: 7.2 Diagnostics */ #ifdef _ASSERT_H diff --git a/bits/wchar.h b/bits/wchar.h index 33cb52656e..76b0f310f0 100644 --- a/bits/wchar.h +++ b/bits/wchar.h @@ -20,7 +20,7 @@ #ifndef _BITS_WCHAR_H #define _BITS_WCHAR_H 1 -#define __WCHAR_MIN (-127) +#define __WCHAR_MIN (-2147483647 - 1) #define __WCHAR_MAX (2147483647) #endif /* bits/wchar.h */ diff --git a/ctype/ctype.h b/ctype/ctype.h index 808e7bbf48..6ae8f75681 100644 --- a/ctype/ctype.h +++ b/ctype/ctype.h @@ -17,7 +17,7 @@ Boston, MA 02111-1307, USA. */ /* - * ISO C Standard 4.3: CHARACTER HANDLING + * ISO C99 Standard 7.4: Character handling */ #ifndef _CTYPE_H diff --git a/include/errno.h b/include/errno.h index 23e0b8f9a9..a4abaa4870 100644 --- a/include/errno.h +++ b/include/errno.h @@ -17,7 +17,7 @@ Boston, MA 02111-1307, USA. */ /* - * ISO C Standard: 4.1.3 Errors + * ISO C99 Standard: 7.5 Errors */ #ifndef _ERRNO_H diff --git a/include/limits.h b/include/limits.h index 23b4f4045a..643c32d91f 100644 --- a/include/limits.h +++ b/include/limits.h @@ -17,7 +17,7 @@ Boston, MA 02111-1307, USA. */ /* - * ISO C Standard: 4.14/2.2.4.2 Limits of integral types + * ISO C99 Standard: 7.10/5.2.4.2.1 Sizes of integer types */ #ifndef _LIBC_LIMITS_H_ diff --git a/include/stdio.h b/include/stdio.h index 0329fe2d1e..8617fea042 100644 --- a/include/stdio.h +++ b/include/stdio.h @@ -1,5 +1,5 @@ #ifndef _STDIO_H -# ifdef __need_FILE +# if defined __need_FILE || defined __need___FILE # ifdef USE_IN_LIBIO # include # else @@ -55,7 +55,7 @@ extern void __flockfile (FILE *__stream); /* Relinquish the ownership granted for STREAM. */ extern void __funlockfile (FILE *__stream); - + # endif #endif diff --git a/include/wchar.h b/include/wchar.h index ee12563e99..c6cc9cb1a3 100644 --- a/include/wchar.h +++ b/include/wchar.h @@ -43,7 +43,7 @@ extern wchar_t *__wmemmove (wchar_t *__s1, __const wchar_t *__s2, extern wchar_t *__wcschrnul (__const wchar_t *__s, wchar_t __wc) __attribute_pure__; -extern int __vfwscanf (FILE *__restrict __s, +extern int __vfwscanf (__FILE *__restrict __s, __const wchar_t *__restrict __format, __gnuc_va_list __arg) /* __attribute__ ((__format__ (__wscanf__, 2, 0)) */; diff --git a/libio/fwprintf.c b/libio/fwprintf.c index c26a2ffcd3..554f1b6389 100644 --- a/libio/fwprintf.c +++ b/libio/fwprintf.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1997, 1999 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1997, 1999, 2000 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -17,6 +17,7 @@ Boston, MA 02111-1307, USA. */ #include +#include #include diff --git a/libio/fwscanf.c b/libio/fwscanf.c index 4510fc5b5f..23dfb2397b 100644 --- a/libio/fwscanf.c +++ b/libio/fwscanf.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1997, 1999 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1997, 1999, 2000 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -17,6 +17,7 @@ Boston, MA 02111-1307, USA. */ #include +#include #include /* Read formatted input from STREAM according to the format string FORMAT. */ diff --git a/libio/getwc.c b/libio/getwc.c index 0829ea0248..77c67c510b 100644 --- a/libio/getwc.c +++ b/libio/getwc.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1993, 95, 96, 97, 98, 99 Free Software Foundation, Inc. +/* Copyright (C) 1993, 95, 96, 97, 98, 99, 2000 Free Software Foundation, Inc. This file is part of the GNU IO Library. This library is free software; you can redistribute it and/or @@ -24,6 +24,7 @@ General Public License. */ #include "libioP.h" +#include #include #undef _IO_getwc diff --git a/libio/stdio.h b/libio/stdio.h index ccab90bc2e..4fcc3b309d 100644 --- a/libio/stdio.h +++ b/libio/stdio.h @@ -17,12 +17,12 @@ Boston, MA 02111-1307, USA. */ /* - * ISO C Standard: 4.9 INPUT/OUTPUT + * ISO C99 Standard: 7.19 Input/output */ #ifndef _STDIO_H -#ifndef __need_FILE +#if !defined __need_FILE && !defined __need___FILE # define _STDIO_H 1 # include @@ -38,17 +38,29 @@ __BEGIN_DECLS # include # include +# define __need_FILE +# define __need___FILE #endif /* Don't need FILE. */ -#undef __need_FILE -#ifndef __FILE_defined +#if !defined __FILE_defined && defined __need_FILE -/* The opaque type of streams. */ +/* The opaque type of streams. This is the definition used elsewhere. */ typedef struct _IO_FILE FILE; # define __FILE_defined 1 #endif /* FILE not defined. */ +#undef __need_FILE + + +#if !defined ____FILE_defined && defined __need___FILE + +/* The opaque type of streams. This is the definition used elsewhere. */ +typedef struct _IO_FILE __FILE; + +# define ____FILE_defined 1 +#endif /* __FILE not defined. */ +#undef __need___FILE #ifdef _STDIO_H diff --git a/locale/locale.h b/locale/locale.h index 0fabedc9cc..5afa10c4dc 100644 --- a/locale/locale.h +++ b/locale/locale.h @@ -17,7 +17,7 @@ Boston, MA 02111-1307, USA. */ /* - * ISO C Standard: 4.4 LOCALIZATION + * ISO C99 Standard: 7.11 Localization */ #ifndef _LOCALE_H diff --git a/math/complex.h b/math/complex.h index 72b498e1fa..bd471263e6 100644 --- a/math/complex.h +++ b/math/complex.h @@ -17,7 +17,7 @@ Boston, MA 02111-1307, USA. */ /* - * ISO C99: 7.8 Complex arithmetic + * ISO C99: 7.3 Complex arithmetic */ #ifndef _COMPLEX_H diff --git a/math/math.h b/math/math.h index b171978a5c..c601c432f0 100644 --- a/math/math.h +++ b/math/math.h @@ -18,7 +18,7 @@ Boston, MA 02111-1307, USA. */ /* - * ISO C Standard: 4.5 MATHEMATICS + * ISO C99 Standard: 7.12 Mathematics */ #ifndef _MATH_H diff --git a/setjmp/setjmp.h b/setjmp/setjmp.h index 0052571069..44bd8d7262 100644 --- a/setjmp/setjmp.h +++ b/setjmp/setjmp.h @@ -17,7 +17,7 @@ Boston, MA 02111-1307, USA. */ /* - * ISO C Standard: 4.6 NON-LOCAL JUMPS + * ISO C99 Standard: 7.13 Nonlocal jumps */ #ifndef _SETJMP_H diff --git a/signal/signal.h b/signal/signal.h index 3cf8025893..090371fb94 100644 --- a/signal/signal.h +++ b/signal/signal.h @@ -17,7 +17,7 @@ Boston, MA 02111-1307, USA. */ /* - * ISO C Standard: 4.7 SIGNAL HANDLING + * ISO C99 Standard: 7.14 Signal handling */ #ifndef _SIGNAL_H diff --git a/stdio/stdio.h b/stdio/stdio.h index 7be0c24c5c..c67ab6326e 100644 --- a/stdio/stdio.h +++ b/stdio/stdio.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1991,92,93,94,95,96,97,98,99 Free Software Foundation, Inc. +/* Copyright (C) 1991-1999, 2000 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -17,12 +17,12 @@ Boston, MA 02111-1307, USA. */ /* - * ISO C Standard: 4.9 INPUT/OUTPUT + * ISO C99 Standard: 7.19 Input/output */ #ifndef _STDIO_H -#if !defined(__need_FILE) +#if !defined(__need_FILE) && !defined(__need___FILE) #define _STDIO_H 1 #include @@ -39,17 +39,29 @@ __BEGIN_DECLS #endif #include +#define __need_FILE +#define __need___FILE #endif /* Don't need FILE. */ -#undef __need_FILE -#ifndef __FILE_defined +#if !defined __FILE_defined && defined __need_FILE /* The opaque type of streams. */ typedef struct __stdio_file FILE; #define __FILE_defined 1 #endif /* FILE not defined. */ +#undef __need_FILE + + +#if !defined ____FILE_defined && defined __need___FILE + +/* The opaque type of streams. */ +typedef struct __stdio_file __FILE; + +#define ____FILE_defined 1 +#endif /* __FILE not defined. */ +#undef __need___FILE #ifdef _STDIO_H diff --git a/stdlib/stdlib.h b/stdlib/stdlib.h index 4b8b4674c2..075f47cd9d 100644 --- a/stdlib/stdlib.h +++ b/stdlib/stdlib.h @@ -17,7 +17,7 @@ Boston, MA 02111-1307, USA. */ /* - * ISO C Standard: 4.10 GENERAL UTILITIES + * ISO C99 Standard: 7.20 General utilities */ #ifndef _STDLIB_H diff --git a/string/string.h b/string/string.h index 1ea0ff5d92..019fcb4448 100644 --- a/string/string.h +++ b/string/string.h @@ -17,7 +17,7 @@ Boston, MA 02111-1307, USA. */ /* - * ISO C Standard: 4.11 STRING HANDLING + * ISO C99 Standard: 7.21 String handling */ #ifndef _STRING_H diff --git a/sysdeps/generic/bits/wchar.h b/sysdeps/generic/bits/wchar.h index 33cb52656e..76b0f310f0 100644 --- a/sysdeps/generic/bits/wchar.h +++ b/sysdeps/generic/bits/wchar.h @@ -20,7 +20,7 @@ #ifndef _BITS_WCHAR_H #define _BITS_WCHAR_H 1 -#define __WCHAR_MIN (-127) +#define __WCHAR_MIN (-2147483647 - 1) #define __WCHAR_MAX (2147483647) #endif /* bits/wchar.h */ diff --git a/sysdeps/generic/stdint.h b/sysdeps/generic/stdint.h index cf4f34e823..d0d427cdd2 100644 --- a/sysdeps/generic/stdint.h +++ b/sysdeps/generic/stdint.h @@ -279,7 +279,7 @@ typedef unsigned long long int uintmax_t; /* Limits of `wint_t'. */ # define WINT_MIN (0u) -# define WINT_MAX (2147483647u) +# define WINT_MAX (4294967295u) #endif /* C++ && limit macros */ diff --git a/sysdeps/unix/sysv/aix/bits/socket.h b/sysdeps/unix/sysv/aix/bits/socket.h index eb5b766e24..febfc7298d 100644 --- a/sysdeps/unix/sysv/aix/bits/socket.h +++ b/sysdeps/unix/sysv/aix/bits/socket.h @@ -243,7 +243,7 @@ __cmsg_nxthdr (struct msghdr *__mhdr, struct cmsghdr *__cmsg) __THROW if ((unsigned char *) (__cmsg + 1) >= ((unsigned char *) __mhdr->msg_control + __mhdr->msg_controllen) || ((unsigned char *) __cmsg + CMSG_ALIGN (__cmsg->cmsg_len) - >= ((unsigned char *) __mhdr->msg_control + __mhdr->msg_controllen))) + > ((unsigned char *) __mhdr->msg_control + __mhdr->msg_controllen))) /* No more entries. */ return 0; return __cmsg; diff --git a/sysdeps/unix/sysv/linux/bits/socket.h b/sysdeps/unix/sysv/linux/bits/socket.h index cf764b15d5..accfdee531 100644 --- a/sysdeps/unix/sysv/linux/bits/socket.h +++ b/sysdeps/unix/sysv/linux/bits/socket.h @@ -267,7 +267,7 @@ __cmsg_nxthdr (struct msghdr *__mhdr, struct cmsghdr *__cmsg) __THROW if ((unsigned char *) (__cmsg + 1) >= ((unsigned char *) __mhdr->msg_control + __mhdr->msg_controllen) || ((unsigned char *) __cmsg + CMSG_ALIGN (__cmsg->cmsg_len) - >= ((unsigned char *) __mhdr->msg_control + __mhdr->msg_controllen))) + > ((unsigned char *) __mhdr->msg_control + __mhdr->msg_controllen))) /* No more entries. */ return 0; return __cmsg; diff --git a/sysdeps/unix/sysv/linux/i386/bits/wchar.h b/sysdeps/unix/sysv/linux/i386/bits/wchar.h index c8d22c7d7d..7e2872ab37 100644 --- a/sysdeps/unix/sysv/linux/i386/bits/wchar.h +++ b/sysdeps/unix/sysv/linux/i386/bits/wchar.h @@ -20,7 +20,7 @@ #ifndef _BITS_WCHAR_H #define _BITS_WCHAR_H 1 -#define __WCHAR_MIN (-127l) +#define __WCHAR_MIN (-2147483647l - 1l) #define __WCHAR_MAX (2147483647l) #endif /* bits/wchar.h */ diff --git a/sysdeps/unix/sysv/linux/mips/bits/socket.h b/sysdeps/unix/sysv/linux/mips/bits/socket.h index d8626c2749..ac7ff0795d 100644 --- a/sysdeps/unix/sysv/linux/mips/bits/socket.h +++ b/sysdeps/unix/sysv/linux/mips/bits/socket.h @@ -267,7 +267,7 @@ __cmsg_nxthdr (struct msghdr *__mhdr, struct cmsghdr *__cmsg) __THROW if ((unsigned char *) (__cmsg + 1) >= ((unsigned char *) __mhdr->msg_control + __mhdr->msg_controllen) || ((unsigned char *) __cmsg + CMSG_ALIGN (__cmsg->cmsg_len) - >= ((unsigned char *) __mhdr->msg_control + __mhdr->msg_controllen))) + > ((unsigned char *) __mhdr->msg_control + __mhdr->msg_controllen))) /* No more entries. */ return 0; return __cmsg; diff --git a/time/time.h b/time/time.h index b2472738ff..c7e965dce5 100644 --- a/time/time.h +++ b/time/time.h @@ -17,7 +17,7 @@ Boston, MA 02111-1307, USA. */ /* - * ISO C Standard: 4.12 DATE and TIME + * ISO C99 Standard: 7.23 Date and time */ #ifndef _TIME_H diff --git a/wcsmbs/wchar.h b/wcsmbs/wchar.h index 9cbc001e9d..92aa5db470 100644 --- a/wcsmbs/wchar.h +++ b/wcsmbs/wchar.h @@ -17,8 +17,8 @@ Boston, MA 02111-1307, USA. */ /* - * ISO C Standard, Amendment 1, 7.16.4 - * General wide-string utilities + * ISO C99 Standard: 7.24 + * Extended multibyte and wide character utilities */ #ifndef _WCHAR_H @@ -30,7 +30,7 @@ #ifdef _WCHAR_H /* Get FILE definition. */ -# define __need_FILE +# define __need___FILE # include /* Get va_list definition. */ # define __need___va_list @@ -537,11 +537,11 @@ extern wchar_t *wcpncpy (wchar_t *__dest, __const wchar_t *__src, size_t __n) #if defined __USE_ISOC99 || defined __USE_UNIX98 /* Select orientation for stream. */ -extern int fwide (FILE *__fp, int __mode) __THROW; +extern int fwide (__FILE *__fp, int __mode) __THROW; /* Write formatted output to STREAM. */ -extern int fwprintf (FILE *__restrict __stream, +extern int fwprintf (__FILE *__restrict __stream, __const wchar_t *__restrict __format, ...) __THROW /* __attribute__ ((__format__ (__wprintf__, 2, 3))) */; /* Write formatted output to stdout. */ @@ -553,7 +553,7 @@ extern int swprintf (wchar_t *__restrict __s, size_t __n, __THROW /* __attribute__ ((__format__ (__wprintf__, 3, 4))) */; /* Write formatted output to S from argument list ARG. */ -extern int vfwprintf (FILE *__restrict __s, +extern int vfwprintf (__FILE *__restrict __s, __const wchar_t *__restrict __format, __gnuc_va_list __arg) __THROW /* __attribute__ ((__format__ (__wprintf__, 2, 0))) */; @@ -570,7 +570,7 @@ extern int vswprintf (wchar_t *__restrict __s, size_t __n, /* Read formatted input from STREAM. */ -extern int fwscanf (FILE *__restrict __stream, +extern int fwscanf (__FILE *__restrict __stream, __const wchar_t *__restrict __format, ...) __THROW /* __attribute__ ((__format__ (__wscanf__, 2, 3))) */; /* Read formatted input from stdin. */ @@ -584,7 +584,7 @@ extern int swscanf (__const wchar_t *__restrict __s, #ifdef __USE_ISOC99 /* Read formatted input from S into argument list ARG. */ -extern int vfwscanf (FILE *__restrict __s, +extern int vfwscanf (__FILE *__restrict __s, __const wchar_t *__restrict __format, __gnuc_va_list __arg) __THROW /* __attribute__ ((__format__ (__wscanf__, 2, 0))) */; @@ -601,16 +601,16 @@ extern int vswscanf (__const wchar_t *__restrict __s, /* Read a character from STREAM. */ -extern wint_t fgetwc (FILE *__stream); -extern wint_t getwc (FILE *__stream); +extern wint_t fgetwc (__FILE *__stream); +extern wint_t getwc (__FILE *__stream); /* Read a character from stdin. */ extern wint_t getwchar (void); /* Write a character to STREAM. */ -extern wint_t fputwc (wchar_t __wc, FILE *__stream); -extern wint_t putwc (wchar_t __wc, FILE *__stream); +extern wint_t fputwc (wchar_t __wc, __FILE *__stream); +extern wint_t putwc (wchar_t __wc, __FILE *__stream); /* Write a character to stdout. */ extern wint_t putwchar (wchar_t __wc); @@ -619,42 +619,42 @@ extern wint_t putwchar (wchar_t __wc); /* Get a newline-terminated wide character string of finite length from STREAM. */ extern wchar_t *fgetws (wchar_t *__restrict __ws, int __n, - FILE *__restrict __stream); + __FILE *__restrict __stream); /* Write a string to STREAM. */ extern int fputws (__const wchar_t *__restrict __ws, - FILE *__restrict __stream); + __FILE *__restrict __stream); /* Push a character back onto the input buffer of STREAM. */ -extern wint_t ungetwc (wint_t __wc, FILE *__stream); +extern wint_t ungetwc (wint_t __wc, __FILE *__stream); #ifdef __USE_GNU /* These are defined to be equivalent to the `char' functions defined in POSIX.1:1996. */ -extern wint_t getwc_unlocked (FILE *__stream); +extern wint_t getwc_unlocked (__FILE *__stream); extern wint_t getwchar_unlocked (void); /* This is the wide character version of a GNU extension. */ -extern wint_t fgetwc_unlocked (FILE *__stream); +extern wint_t fgetwc_unlocked (__FILE *__stream); /* Faster version when locking is not necessary. */ -extern wint_t fputwc_unlocked (wchar_t __wc, FILE *__stream); +extern wint_t fputwc_unlocked (wchar_t __wc, __FILE *__stream); /* These are defined to be equivalent to the `char' functions defined in POSIX.1:1996. */ -extern wint_t putwc_unlocked (wchar_t __wc, FILE *__stream); +extern wint_t putwc_unlocked (wchar_t __wc, __FILE *__stream); extern wint_t putwchar_unlocked (wchar_t __wc); /* This function does the same as `fgetws' but does not lock the stream. */ extern wchar_t *fgetws_unlocked (wchar_t *__restrict __ws, int __n, - FILE *__restrict __stream); + __FILE *__restrict __stream); /* This function does the same as `fputws' but does not lock the stream. */ extern int fputws_unlocked (__const wchar_t *__restrict __ws, - FILE *__restrict __stream); + __FILE *__restrict __stream); #endif diff --git a/wctype/wctype.h b/wctype/wctype.h index c85e5616bb..a6b351dee9 100644 --- a/wctype/wctype.h +++ b/wctype/wctype.h @@ -17,8 +17,8 @@ Boston, MA 02111-1307, USA. */ /* - * ISO C Standard, Amendment 1, 7.15: - * Wide-character classification and mapping utilities + * ISO C99 Standard: 7.25 + * Wide character classification and mapping utilities */ #ifndef _WCTYPE_H