summaryrefslogtreecommitdiff
path: root/wcsmbs
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2007-09-18 19:57:24 +0000
committerJakub Jelinek <jakub@redhat.com>2007-09-18 19:57:24 +0000
commit7913ba4d91b848ec4e5698c59d43198a3ef9215d (patch)
treeafc73f6e0376ae6d07526c5efa9e941641ce1f6d /wcsmbs
parentcedf9b89dd3b436ff7fad4c75d3f288ee4cd4ecd (diff)
Updated to fedora-glibc-20070918T1931cvs/fedora-glibc-2_6_90-14
Diffstat (limited to 'wcsmbs')
-rw-r--r--wcsmbs/Makefile14
-rw-r--r--wcsmbs/Versions4
-rw-r--r--wcsmbs/bits/wchar-ldbl.h19
-rw-r--r--wcsmbs/bits/wchar2.h76
-rw-r--r--wcsmbs/isoc99_fwscanf.c41
-rw-r--r--wcsmbs/isoc99_swscanf.c38
-rw-r--r--wcsmbs/isoc99_vfwscanf.c36
-rw-r--r--wcsmbs/isoc99_vswscanf.c49
-rw-r--r--wcsmbs/isoc99_vwscanf.c35
-rw-r--r--wcsmbs/isoc99_wscanf.c43
-rw-r--r--wcsmbs/wchar.h66
11 files changed, 400 insertions, 21 deletions
diff --git a/wcsmbs/Makefile b/wcsmbs/Makefile
index 7a289a8dc7..4afbc4cac4 100644
--- a/wcsmbs/Makefile
+++ b/wcsmbs/Makefile
@@ -1,4 +1,4 @@
-# Copyright (C) 1995-2000,2002,2003,2004,2005,2006
+# Copyright (C) 1995-2000,2002,2003,2004,2005,2006,2007
# Free Software Foundation, Inc.
# This file is part of the GNU C Library.
@@ -38,7 +38,9 @@ routines := wcscat wcschr wcscmp wcscpy wcscspn wcsdup wcslen wcsncat \
wcwidth wcswidth \
wcscoll_l wcsxfrm_l \
wcscasecmp wcsncase wcscasecmp_l wcsncase_l \
- wcsmbsload mbsrtowcs_l
+ wcsmbsload mbsrtowcs_l \
+ isoc99_wscanf isoc99_vwscanf isoc99_fwscanf isoc99_vfwscanf \
+ isoc99_swscanf isoc99_vswscanf
tests := tst-wcstof wcsmbs-tst1 tst-wcsnlen tst-btowc tst-mbrtowc \
tst-wcrtomb tst-wcpncpy tst-mbsrtowcs tst-wchar-h tst-mbrtowc2
@@ -65,6 +67,14 @@ CFLAGS-wcstold_l.c = $(strtox-CFLAGS)
CFLAGS-wcstof_l.c = $(strtox-CFLAGS)
CFLAGS-tst-wchar-h.c = -D_FORTIFY_SOURCE=2
+CFLAGS-isoc99_wscanf.c += $(exceptions)
+CFLAGS-isoc99_fwscanf.c += $(exceptions)
+CFLAGS-isoc99_vwscanf.c += $(exceptions)
+CFLAGS-isoc99_vfwscanf.c += $(exceptions)
+ifneq (,$(filter %REENTRANT, $(defines)))
+CPPFLAGS += -D_IO_MTSAFE_IO
+endif
+
# We need to find the default version of strtold_l in stdlib.
CPPFLAGS-wcstold_l.c = -I../stdlib
diff --git a/wcsmbs/Versions b/wcsmbs/Versions
index 6f2e72eb2a..b6dfa85a40 100644
--- a/wcsmbs/Versions
+++ b/wcsmbs/Versions
@@ -24,4 +24,8 @@ libc {
# w*
wcschrnul; wmempcpy;
}
+ GLIBC_2.7 {
+ __isoc99_wscanf; __isoc99_vwscanf; __isoc99_fwscanf; __isoc99_vfwscanf;
+ __isoc99_swscanf; __isoc99_vswscanf;
+ }
}
diff --git a/wcsmbs/bits/wchar-ldbl.h b/wcsmbs/bits/wchar-ldbl.h
index 56a28d33b9..80a6a684ab 100644
--- a/wcsmbs/bits/wchar-ldbl.h
+++ b/wcsmbs/bits/wchar-ldbl.h
@@ -21,7 +21,7 @@
# error "Never include <bits/wchar-ldbl.h> directly; use <wchar.h> instead."
#endif
-#if defined __USE_ISOC99 || defined __USE_UNIX98
+#if defined __USE_ISOC95 || defined __USE_UNIX98
__BEGIN_NAMESPACE_C99
__LDBL_REDIR_DECL (fwprintf);
__LDBL_REDIR_DECL (wprintf);
@@ -29,18 +29,33 @@ __LDBL_REDIR_DECL (swprintf);
__LDBL_REDIR_DECL (vfwprintf);
__LDBL_REDIR_DECL (vwprintf);
__LDBL_REDIR_DECL (vswprintf);
+# if defined __USE_ISOC99 && !defined __USE_GNU \
+ && !defined __REDIRECT \
+ && (defined __STRICT_ANSI__ || defined __USE_XOPEN2K)
+__LDBL_REDIR1_DECL (fwscanf, __nldbl___isoc99_fwscanf)
+__LDBL_REDIR1_DECL (wscanf, __nldbl___isoc99_wscanf)
+__LDBL_REDIR1_DECL (swscanf, __nldbl___isoc99_swscanf)
+# else
__LDBL_REDIR_DECL (fwscanf);
__LDBL_REDIR_DECL (wscanf);
__LDBL_REDIR_DECL (swscanf);
+# endif
__END_NAMESPACE_C99
#endif
#ifdef __USE_ISOC99
__BEGIN_NAMESPACE_C99
__LDBL_REDIR1_DECL (wcstold, wcstod);
+# if !defined __USE_GNU && !defined __REDIRECT \
+ && (defined __STRICT_ANSI__ || defined __USE_XOPEN2K)
+__LDBL_REDIR1_DECL (vfwscanf, __nldbl___isoc99_vfwscanf)
+__LDBL_REDIR1_DECL (vwscanf, __nldbl___isoc99_vwscanf)
+__LDBL_REDIR1_DECL (vswscanf, __nldbl___isoc99_vswscanf)
+# else
__LDBL_REDIR_DECL (vfwscanf);
__LDBL_REDIR_DECL (vwscanf);
__LDBL_REDIR_DECL (vswscanf);
+# endif
__END_NAMESPACE_C99
#endif
@@ -48,7 +63,7 @@ __END_NAMESPACE_C99
__LDBL_REDIR1_DECL (wcstold_l, wcstod_l);
#endif
-#if __USE_FORTIFY_LEVEL > 0 && !defined __cplusplus
+#if __USE_FORTIFY_LEVEL > 0 && defined __extern_always_inline
__LDBL_REDIR_DECL (__swprintf_chk)
__LDBL_REDIR_DECL (__vswprintf_chk)
# if __USE_FORTIFY_LEVEL > 1
diff --git a/wcsmbs/bits/wchar2.h b/wcsmbs/bits/wchar2.h
index 697b9f2cd8..e1b7c13023 100644
--- a/wcsmbs/bits/wchar2.h
+++ b/wcsmbs/bits/wchar2.h
@@ -18,7 +18,7 @@
02111-1307 USA. */
#ifndef _WCHAR_H
-# error "Never include <bits/wchar.h> directly; use <wchar.h> instead."
+# error "Never include <bits/wchar2.h> directly; use <wchar.h> instead."
#endif
@@ -198,12 +198,28 @@ extern int __swprintf_chk (wchar_t *__restrict __s, size_t __n,
__const wchar_t *__restrict __format, ...)
__THROW /* __attribute__ ((__format__ (__wprintf__, 5, 6))) */;
+extern int __REDIRECT_NTH (__swprintf_alias,
+ (wchar_t *__restrict __s, size_t __n,
+ __const wchar_t *__restrict __fmt, ...),
+ swprintf);
+
+#ifdef __va_arg_pack
+__extern_always_inline int
+__NTH (swprintf (wchar_t *__restrict __s, size_t __n,
+ __const wchar_t *__restrict __fmt, ...))
+{
+ if (__bos (__s) != (size_t) -1 || __USE_FORTIFY_LEVEL > 1)
+ return __swprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1, __bos (__s),
+ __fmt, __va_arg_pack ());
+ return __swprintf_alias (__s, __n, __fmt, __va_arg_pack ());
+}
+#elif !defined __cplusplus
/* XXX We might want to have support in gcc for swprintf. */
-#define swprintf(s, n, ...) \
+# define swprintf(s, n, ...) \
(__bos (s) != (size_t) -1 || __USE_FORTIFY_LEVEL > 1 \
? __swprintf_chk (s, n, __USE_FORTIFY_LEVEL - 1, __bos (s), __VA_ARGS__) \
: swprintf (s, n, __VA_ARGS__))
-
+#endif
extern int __vswprintf_chk (wchar_t *__restrict __s, size_t __n,
int __flag, size_t __s_len,
@@ -211,10 +227,20 @@ extern int __vswprintf_chk (wchar_t *__restrict __s, size_t __n,
__gnuc_va_list __arg)
__THROW /* __attribute__ ((__format__ (__wprintf__, 5, 0))) */;
-#define vswprintf(s, n, fmt, ap) \
- (__bos (s) != (size_t) -1 || __USE_FORTIFY_LEVEL > 1 \
- ? __vswprintf_chk (s, n, __USE_FORTIFY_LEVEL - 1, __bos (s), fmt, ap) \
- : vswprintf (s, n, fmt, ap))
+extern int __REDIRECT_NTH (__vswprintf_alias,
+ (wchar_t *__restrict __s, size_t __n,
+ __const wchar_t *__restrict __fmt,
+ __gnuc_va_list __ap), vswprintf);
+
+__extern_always_inline int
+__NTH (vswprintf (wchar_t *__restrict __s, size_t __n,
+ __const wchar_t *__restrict __fmt, __gnuc_va_list __ap))
+{
+ if (__bos (__s) != (size_t) -1 || __USE_FORTIFY_LEVEL > 1)
+ return __vswprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1, __bos (__s),
+ __fmt, __ap);
+ return __vswprintf_alias (__s, __n, __fmt, __ap);
+}
#if __USE_FORTIFY_LEVEL > 1
@@ -229,14 +255,38 @@ extern int __vfwprintf_chk (__FILE *__restrict __stream, int __flag,
extern int __vwprintf_chk (int __flag, __const wchar_t *__restrict __format,
__gnuc_va_list __ap);
-# define wprintf(...) \
+# ifdef __va_arg_pack
+__extern_always_inline int
+wprintf (__const wchar_t *__restrict __fmt, ...)
+{
+ return __wprintf_chk (__USE_FORTIFY_LEVEL - 1, __fmt, __va_arg_pack ());
+}
+
+__extern_always_inline int
+fwprintf (__FILE *__restrict __stream, __const wchar_t *__restrict __fmt, ...)
+{
+ return __fwprintf_chk (__stream, __USE_FORTIFY_LEVEL - 1, __fmt,
+ __va_arg_pack ());
+}
+# elif !defined __cplusplus
+# define wprintf(...) \
__wprintf_chk (__USE_FORTIFY_LEVEL - 1, __VA_ARGS__)
-# define fwprintf(stream, ...) \
+# define fwprintf(stream, ...) \
__fwprintf_chk (stream, __USE_FORTIFY_LEVEL - 1, __VA_ARGS__)
-# define vwprintf(format, ap) \
- __vwprintf_chk (__USE_FORTIFY_LEVEL - 1, format, ap)
-# define vfwprintf(stream, format, ap) \
- __vfwprintf_chk (stream, __USE_FORTIFY_LEVEL - 1, format, ap)
+# endif
+
+__extern_always_inline int
+vwprintf (__const wchar_t *__restrict __fmt, __gnuc_va_list __ap)
+{
+ return __vwprintf_chk (__USE_FORTIFY_LEVEL - 1, __fmt, __ap);
+}
+
+__extern_always_inline int
+vfwprintf (__FILE *__restrict __stream,
+ __const wchar_t *__restrict __fmt, __gnuc_va_list __ap)
+{
+ return __vfwprintf_chk (__stream, __USE_FORTIFY_LEVEL - 1, __fmt, __ap);
+}
#endif
diff --git a/wcsmbs/isoc99_fwscanf.c b/wcsmbs/isoc99_fwscanf.c
new file mode 100644
index 0000000000..ce12ad8f90
--- /dev/null
+++ b/wcsmbs/isoc99_fwscanf.c
@@ -0,0 +1,41 @@
+/* Copyright (C) 1991, 1997, 2006, 2007 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
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#include <libioP.h>
+#include <stdarg.h>
+#include <stdio.h>
+#include <wchar.h>
+
+/* Read formatted input from STREAM according to the format string FORMAT. */
+/* VARARGS2 */
+int
+__isoc99_fwscanf (FILE *stream, const wchar_t *format, ...)
+{
+ va_list arg;
+ int done;
+
+ _IO_acquire_lock_clear_flags2 (stream);
+ stream->_flags2 |= _IO_FLAGS2_SCANF_STD;
+
+ va_start (arg, format);
+ done = _IO_vfwscanf (stream, format, arg, NULL);
+ va_end (arg);
+
+ _IO_release_lock (stream);
+ return done;
+}
diff --git a/wcsmbs/isoc99_swscanf.c b/wcsmbs/isoc99_swscanf.c
new file mode 100644
index 0000000000..fed05eff35
--- /dev/null
+++ b/wcsmbs/isoc99_swscanf.c
@@ -0,0 +1,38 @@
+/* Copyright (C) 1991, 1995, 1996, 1998, 2002, 2003, 2004, 2006, 2007
+ 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
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#include <stdarg.h>
+#include <stdio.h>
+#include <libioP.h>
+#include <wchar.h>
+
+/* Read formatted input from S, according to the format string FORMAT. */
+/* VARARGS2 */
+int
+__isoc99_swscanf (const wchar_t *s, const wchar_t *format, ...)
+{
+ va_list arg;
+ int done;
+
+ va_start (arg, format);
+ done = __isoc99_vswscanf (s, format, arg);
+ va_end (arg);
+
+ return done;
+}
diff --git a/wcsmbs/isoc99_vfwscanf.c b/wcsmbs/isoc99_vfwscanf.c
new file mode 100644
index 0000000000..7564503e88
--- /dev/null
+++ b/wcsmbs/isoc99_vfwscanf.c
@@ -0,0 +1,36 @@
+/* Copyright (C) 1991, 1997, 2006, 2007 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
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#include <libioP.h>
+#include <stdio.h>
+#include <wchar.h>
+
+/* Read formatted input from STREAM according to the format string FORMAT. */
+/* VARARGS2 */
+int
+__isoc99_vfwscanf (FILE *stream, const wchar_t *format, _IO_va_list args)
+{
+ int done;
+
+ _IO_acquire_lock_clear_flags2 (stream);
+ stream->_flags2 |= _IO_FLAGS2_SCANF_STD;
+ done = _IO_vfwscanf (stream, format, args, NULL);
+ _IO_release_lock (stream);
+ return done;
+}
+libc_hidden_def (__isoc99_vfwscanf)
diff --git a/wcsmbs/isoc99_vswscanf.c b/wcsmbs/isoc99_vswscanf.c
new file mode 100644
index 0000000000..4d7081e43d
--- /dev/null
+++ b/wcsmbs/isoc99_vswscanf.c
@@ -0,0 +1,49 @@
+/* Copyright (C) 1993, 1997-2003, 2006, 2007 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
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA.
+
+ As a special exception, if you link the code in this file with
+ files compiled with a GNU compiler to produce an executable,
+ that does not cause the resulting executable to be covered by
+ the GNU Lesser General Public License. This exception does not
+ however invalidate any other reasons why the executable file
+ might be covered by the GNU Lesser General Public License.
+ This exception applies to code released by its copyright holders
+ in files containing the exception. */
+
+#include <libioP.h>
+#include <wchar.h>
+#include "../libio/strfile.h"
+
+int
+__isoc99_vswscanf (const wchar_t *string, const wchar_t *format,
+ _IO_va_list args)
+{
+ int ret;
+ _IO_strfile sf;
+ struct _IO_wide_data wd;
+#ifdef _IO_MTSAFE_IO
+ sf._sbf._f._lock = NULL;
+#endif
+ _IO_no_init (&sf._sbf._f, _IO_USER_LOCK, 0, &wd, &_IO_wstr_jumps);
+ _IO_fwide (&sf._sbf._f, 1);
+ _IO_wstr_init_static (&sf._sbf._f, (wchar_t *)string, 0, NULL);
+ sf._sbf._f._flags2 |= _IO_FLAGS2_SCANF_STD;
+ ret = _IO_vfwscanf ((_IO_FILE *) &sf._sbf, format, args, NULL);
+ return ret;
+}
+libc_hidden_def (__isoc99_vswscanf)
diff --git a/wcsmbs/isoc99_vwscanf.c b/wcsmbs/isoc99_vwscanf.c
new file mode 100644
index 0000000000..8a0b345f05
--- /dev/null
+++ b/wcsmbs/isoc99_vwscanf.c
@@ -0,0 +1,35 @@
+/* Copyright (C) 1991, 1997, 2006, 2007 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
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#include <libioP.h>
+#include <stdio.h>
+#include <wchar.h>
+
+/* Read formatted input from STDIN according to the format string FORMAT. */
+/* VARARGS2 */
+int
+__isoc99_vwscanf (const wchar_t *format, _IO_va_list args)
+{
+ int done;
+
+ _IO_acquire_lock_clear_flags2 (stdin);
+ stdin->_flags2 |= _IO_FLAGS2_SCANF_STD;
+ done = _IO_vfwscanf (stdin, format, args, NULL);
+ _IO_release_lock (stdin);
+ return done;
+}
diff --git a/wcsmbs/isoc99_wscanf.c b/wcsmbs/isoc99_wscanf.c
new file mode 100644
index 0000000000..581e05fefb
--- /dev/null
+++ b/wcsmbs/isoc99_wscanf.c
@@ -0,0 +1,43 @@
+/* Copyright (C) 1991, 1995, 1996, 1997, 2002, 2004, 2006, 2007
+ 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
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#include <stdarg.h>
+#include <stdio.h>
+#include <libioP.h>
+#include <wchar.h>
+
+
+/* Read formatted input from stdin according to the format string FORMAT. */
+/* VARARGS1 */
+int
+__isoc99_wscanf (const wchar_t *format, ...)
+{
+ va_list arg;
+ int done;
+
+ _IO_acquire_lock_clear_flags2 (stdin);
+ stdin->_flags2 |= _IO_FLAGS2_SCANF_STD;
+
+ va_start (arg, format);
+ done = _IO_vfwscanf (stdin, format, arg, NULL);
+ va_end (arg);
+
+ _IO_release_lock (stdin);
+ return done;
+}
diff --git a/wcsmbs/wchar.h b/wcsmbs/wchar.h
index b334e06231..e8448c86d9 100644
--- a/wcsmbs/wchar.h
+++ b/wcsmbs/wchar.h
@@ -327,7 +327,6 @@ __END_NAMESPACE_C99
#ifdef __USE_EXTERN_INLINES
/* Define inline function as optimization. */
-# ifndef __cplusplus
/* We can use the BTOWC and WCTOB optimizations since we know that all
locales must use ASCII encoding for the values in the ASCII range
and because the wchar_t encoding is always ISO 10646. */
@@ -342,7 +341,6 @@ __extern_inline int
__NTH (wctob (wint_t __wc))
{ return (__builtin_constant_p (__wc) && __wc >= L'\0' && __wc <= L'\x7f'
? (int) __wc : __wctob_alias (__wc)); }
-# endif
__extern_inline size_t
__NTH (mbrlen (__const char *__restrict __s, size_t __n,
@@ -589,12 +587,42 @@ extern int swscanf (__const wchar_t *__restrict __s,
__const wchar_t *__restrict __format, ...)
__THROW /* __attribute__ ((__format__ (__wscanf__, 2, 3))) */;
+# if defined __USE_ISOC99 && !defined __USE_GNU \
+ && (!defined __LDBL_COMPAT || !defined __REDIRECT) \
+ && (defined __STRICT_ANSI__ || defined __USE_XOPEN2K)
+# ifdef __REDIRECT
+/* For strict ISO C99 or POSIX compliance disallow %as, %aS and %a[
+ GNU extension which conflicts with valid %a followed by letter
+ s, S or [. */
+extern int __REDIRECT (fwscanf, (__FILE *__restrict __stream,
+ __const wchar_t *__restrict __format, ...),
+ __isoc99_fwscanf)
+ /* __attribute__ ((__format__ (__wscanf__, 2, 3))) */;
+extern int __REDIRECT (wscanf, (__const wchar_t *__restrict __format, ...),
+ __isoc99_wscanf)
+ /* __attribute__ ((__format__ (__wscanf__, 1, 2))) */;
+extern int __REDIRECT (swscanf, (__const wchar_t *__restrict __s,
+ __const wchar_t *__restrict __format, ...),
+ __isoc99_swscanf)
+ __THROW /* __attribute__ ((__format__ (__wscanf__, 2, 3))) */;
+# else
+extern int __isoc99_fwscanf (__FILE *__restrict __stream,
+ __const wchar_t *__restrict __format, ...);
+extern int __isoc99_wscanf (__const wchar_t *__restrict __format, ...);
+extern int __isoc99_swscanf (__const wchar_t *__restrict __s,
+ __const wchar_t *__restrict __format, ...)
+ __THROW;
+# define fwscanf __isoc99_fwscanf
+# define wscanf __isoc99_wscanf
+# define swscanf __isoc99_swscanf
+# endif
+# endif
+
__END_NAMESPACE_C99
#endif /* Use ISO C95, C99 and Unix98. */
#ifdef __USE_ISOC99
__BEGIN_NAMESPACE_C99
-
/* Read formatted input from S into argument list ARG.
This function is a possible cancellation point and therefore not
@@ -616,6 +644,36 @@ extern int vswscanf (__const wchar_t *__restrict __s,
__gnuc_va_list __arg)
__THROW /* __attribute__ ((__format__ (__wscanf__, 2, 0))) */;
+# if !defined __USE_GNU \
+ && (!defined __LDBL_COMPAT || !defined __REDIRECT) \
+ && (defined __STRICT_ANSI__ || defined __USE_XOPEN2K)
+# ifdef __REDIRECT
+extern int __REDIRECT (vfwscanf, (__FILE *__restrict __s,
+ __const wchar_t *__restrict __format,
+ __gnuc_va_list __arg), __isoc99_vfwscanf)
+ /* __attribute__ ((__format__ (__wscanf__, 2, 0))) */;
+extern int __REDIRECT (vwscanf, (__const wchar_t *__restrict __format,
+ __gnuc_va_list __arg), __isoc99_vwscanf)
+ /* __attribute__ ((__format__ (__wscanf__, 1, 0))) */;
+extern int __REDIRECT (vswscanf, (__const wchar_t *__restrict __s,
+ __const wchar_t *__restrict __format,
+ __gnuc_va_list __arg), __isoc99_vswscanf)
+ __THROW /* __attribute__ ((__format__ (__wscanf__, 2, 0))) */;
+# else
+extern int __isoc99_vfwscanf (__FILE *__restrict __s,
+ __const wchar_t *__restrict __format,
+ __gnuc_va_list __arg);
+extern int __isoc99_vwscanf (__const wchar_t *__restrict __format,
+ __gnuc_va_list __arg);
+extern int __isoc99_vswscanf (__const wchar_t *__restrict __s,
+ __const wchar_t *__restrict __format,
+ __gnuc_va_list __arg) __THROW;
+# define vfwscanf __isoc99_vfwscanf
+# define vwscanf __isoc99_vwscanf
+# define vswscanf __isoc99_vswscanf
+# endif
+# endif
+
__END_NAMESPACE_C99
#endif /* Use ISO C99. */
@@ -763,7 +821,7 @@ extern size_t wcsftime_l (wchar_t *__restrict __s, size_t __maxsize,
#endif
/* Define some macros helping to catch buffer overflows. */
-#if __USE_FORTIFY_LEVEL > 0 && !defined __cplusplus
+#if __USE_FORTIFY_LEVEL > 0 && defined __extern_always_inline
# include <bits/wchar2.h>
#endif