2.9
[glibc/nacl-glibc.git] / sysdeps / ieee754 / ldbl-opt / nldbl-compat.c
blobf692a455da535782af831b5e439bbed09d7aa239
1 /* *printf* family compatibility routines for IEEE double as long double
2 Copyright (C) 2006, 2007, 2008 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
4 Contributed by Jakub Jelinek <jakub@cygnus.com>, 2006.
6 The GNU C Library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Lesser General Public
8 License as published by the Free Software Foundation; either
9 version 2.1 of the License, or (at your option) any later version.
11 The GNU C Library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Lesser General Public License for more details.
16 You should have received a copy of the GNU Lesser General Public
17 License along with the GNU C Library; if not, write to the Free
18 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
19 02111-1307 USA. */
21 #include <stdarg.h>
22 #include <stdio.h>
23 #include <libioP.h>
24 #include <wchar.h>
25 #include <printf.h>
26 #include <monetary.h>
27 #include <locale/localeinfo.h>
28 #include <sys/syslog.h>
29 #include <bits/libc-lock.h>
31 #include "nldbl-compat.h"
33 libc_hidden_proto (__nldbl_vfprintf)
34 libc_hidden_proto (__nldbl_vsscanf)
35 libc_hidden_proto (__nldbl_vsprintf)
36 libc_hidden_proto (__nldbl_vfscanf)
37 libc_hidden_proto (__nldbl_vfwscanf)
38 libc_hidden_proto (__nldbl_vdprintf)
39 libc_hidden_proto (__nldbl_vswscanf)
40 libc_hidden_proto (__nldbl_vfwprintf)
41 libc_hidden_proto (__nldbl_vswprintf)
42 libc_hidden_proto (__nldbl_vsnprintf)
43 libc_hidden_proto (__nldbl_vasprintf)
44 libc_hidden_proto (__nldbl_obstack_vprintf)
45 libc_hidden_proto (__nldbl___vfwprintf_chk)
46 libc_hidden_proto (__nldbl___vsnprintf_chk)
47 libc_hidden_proto (__nldbl___vfprintf_chk)
48 libc_hidden_proto (__nldbl___vsyslog_chk)
49 libc_hidden_proto (__nldbl___vsprintf_chk)
50 libc_hidden_proto (__nldbl___vswprintf_chk)
51 libc_hidden_proto (__nldbl___vasprintf_chk)
52 libc_hidden_proto (__nldbl___vdprintf_chk)
53 libc_hidden_proto (__nldbl___obstack_vprintf_chk)
54 libc_hidden_proto (__nldbl___vstrfmon)
55 libc_hidden_proto (__nldbl___vstrfmon_l)
56 libc_hidden_proto (__nldbl___isoc99_vsscanf)
57 libc_hidden_proto (__nldbl___isoc99_vfscanf)
58 libc_hidden_proto (__nldbl___isoc99_vswscanf)
59 libc_hidden_proto (__nldbl___isoc99_vfwscanf)
61 static void
62 __nldbl_cleanup (void *arg)
64 __no_long_double = 0;
67 #define set_no_long_double() \
68 __libc_cleanup_push (__nldbl_cleanup, NULL); __no_long_double = 1
69 #define clear_no_long_double() \
70 __no_long_double = 0; __libc_cleanup_pop (0)
72 /* Compatibility with IEEE double as long double.
73 IEEE quad long double is used by default for most programs, so
74 we don't need to split this into one file per function for the
75 sake of statically linked programs. */
77 int
78 attribute_compat_text_section
79 __nldbl___asprintf (char **string_ptr, const char *fmt, ...)
81 va_list arg;
82 int done;
84 va_start (arg, fmt);
85 done = __nldbl_vasprintf (string_ptr, fmt, arg);
86 va_end (arg);
88 return done;
90 weak_alias (__nldbl___asprintf, __nldbl_asprintf)
92 int
93 attribute_compat_text_section
94 __nldbl_dprintf (int d, const char *fmt, ...)
96 va_list arg;
97 int done;
99 va_start (arg, fmt);
100 done = __nldbl_vdprintf (d, fmt, arg);
101 va_end (arg);
103 return done;
107 attribute_compat_text_section
108 __nldbl_fprintf (FILE *stream, const char *fmt, ...)
110 va_list arg;
111 int done;
113 va_start (arg, fmt);
114 done = __nldbl_vfprintf (stream, fmt, arg);
115 va_end (arg);
117 return done;
119 weak_alias (__nldbl_fprintf, __nldbl__IO_fprintf)
122 attribute_compat_text_section weak_function
123 __nldbl_fwprintf (FILE *stream, const wchar_t *fmt, ...)
125 va_list arg;
126 int done;
128 va_start (arg, fmt);
129 done = __nldbl_vfwprintf (stream, fmt, arg);
130 va_end (arg);
132 return done;
136 attribute_compat_text_section
137 __nldbl_printf (const char *fmt, ...)
139 va_list arg;
140 int done;
142 va_start (arg, fmt);
143 done = __nldbl_vfprintf (stdout, fmt, arg);
144 va_end (arg);
146 return done;
148 strong_alias (__nldbl_printf, __nldbl__IO_printf)
151 attribute_compat_text_section
152 __nldbl_sprintf (char *s, const char *fmt, ...)
154 va_list arg;
155 int done;
157 va_start (arg, fmt);
158 done = __nldbl_vsprintf (s, fmt, arg);
159 va_end (arg);
161 return done;
163 strong_alias (__nldbl_sprintf, __nldbl__IO_sprintf)
166 attribute_compat_text_section
167 __nldbl_vfprintf (FILE *s, const char *fmt, va_list ap)
169 int done;
170 set_no_long_double ();
171 done = INTUSE(_IO_vfprintf) (s, fmt, ap);
172 clear_no_long_double ();
173 return done;
175 libc_hidden_def (__nldbl_vfprintf)
176 strong_alias (__nldbl_vfprintf, __nldbl__IO_vfprintf)
179 attribute_compat_text_section
180 __nldbl__IO_vsprintf (char *string, const char *fmt, va_list ap)
182 int done;
183 __no_long_double = 1;
184 done = INTUSE(_IO_vsprintf) (string, fmt, ap);
185 __no_long_double = 0;
186 return done;
188 weak_alias (__nldbl__IO_vsprintf, __nldbl_vsprintf)
189 libc_hidden_def (__nldbl_vsprintf)
192 attribute_compat_text_section
193 __nldbl_obstack_vprintf (struct obstack *obstack, const char *fmt,
194 va_list ap)
196 int done;
197 __no_long_double = 1;
198 done = _IO_obstack_vprintf (obstack, fmt, ap);
199 __no_long_double = 0;
200 return done;
202 libc_hidden_def (__nldbl_obstack_vprintf)
205 attribute_compat_text_section
206 __nldbl_obstack_printf (struct obstack *obstack, const char *fmt, ...)
208 int result;
209 va_list ap;
210 va_start (ap, fmt);
211 result = __nldbl_obstack_vprintf (obstack, fmt, ap);
212 va_end (ap);
213 return result;
217 attribute_compat_text_section weak_function
218 __nldbl_snprintf (char *s, size_t maxlen, const char *fmt, ...)
220 va_list arg;
221 int done;
223 va_start (arg, fmt);
224 done = __nldbl_vsnprintf (s, maxlen, fmt, arg);
225 va_end (arg);
227 return done;
231 attribute_compat_text_section
232 __nldbl_swprintf (wchar_t *s, size_t n, const wchar_t *fmt, ...)
234 va_list arg;
235 int done;
237 va_start (arg, fmt);
238 done = __nldbl_vswprintf (s, n, fmt, arg);
239 va_end (arg);
241 return done;
245 attribute_compat_text_section weak_function
246 __nldbl_vasprintf (char **result_ptr, const char *fmt, va_list ap)
248 int res;
249 __no_long_double = 1;
250 res = _IO_vasprintf (result_ptr, fmt, ap);
251 __no_long_double = 0;
252 return res;
254 libc_hidden_def (__nldbl_vasprintf)
257 attribute_compat_text_section
258 __nldbl_vdprintf (int d, const char *fmt, va_list arg)
260 int res;
261 set_no_long_double ();
262 res = _IO_vdprintf (d, fmt, arg);
263 clear_no_long_double ();
264 return res;
266 libc_hidden_def (__nldbl_vdprintf)
269 attribute_compat_text_section weak_function
270 __nldbl_vfwprintf (FILE *s, const wchar_t *fmt, va_list ap)
272 int res;
273 set_no_long_double ();
274 res = _IO_vfwprintf (s, fmt, ap);
275 clear_no_long_double ();
276 return res;
278 libc_hidden_def (__nldbl_vfwprintf)
281 attribute_compat_text_section
282 __nldbl_vprintf (const char *fmt, va_list ap)
284 return __nldbl_vfprintf (stdout, fmt, ap);
288 attribute_compat_text_section
289 __nldbl_vsnprintf (char *string, size_t maxlen, const char *fmt,
290 va_list ap)
292 int res;
293 __no_long_double = 1;
294 res = _IO_vsnprintf (string, maxlen, fmt, ap);
295 __no_long_double = 0;
296 return res;
298 libc_hidden_def (__nldbl_vsnprintf)
299 weak_alias (__nldbl_vsnprintf, __nldbl___vsnprintf)
302 attribute_compat_text_section weak_function
303 __nldbl_vswprintf (wchar_t *string, size_t maxlen, const wchar_t *fmt,
304 va_list ap)
306 int res;
307 __no_long_double = 1;
308 res = _IO_vswprintf (string, maxlen, fmt, ap);
309 __no_long_double = 0;
310 return res;
312 libc_hidden_def (__nldbl_vswprintf)
315 attribute_compat_text_section
316 __nldbl_vwprintf (const wchar_t *fmt, va_list ap)
318 return __nldbl_vfwprintf (stdout, fmt, ap);
322 attribute_compat_text_section
323 __nldbl_wprintf (const wchar_t *fmt, ...)
325 va_list arg;
326 int done;
328 va_start (arg, fmt);
329 done = __nldbl_vfwprintf (stdout, fmt, arg);
330 va_end (arg);
332 return done;
336 attribute_compat_text_section
337 __nldbl__IO_vfscanf (FILE *s, const char *fmt, _IO_va_list ap,
338 int *errp)
340 int res;
341 set_no_long_double ();
342 res = INTUSE(_IO_vfscanf) (s, fmt, ap, errp);
343 clear_no_long_double ();
344 return res;
348 attribute_compat_text_section
349 __nldbl___vfscanf (FILE *s, const char *fmt, va_list ap)
351 int res;
352 set_no_long_double ();
353 res = INTUSE(_IO_vfscanf) (s, fmt, ap, NULL);
354 clear_no_long_double ();
355 return res;
357 weak_alias (__nldbl___vfscanf, __nldbl_vfscanf)
358 libc_hidden_def (__nldbl_vfscanf)
361 attribute_compat_text_section
362 __nldbl_sscanf (const char *s, const char *fmt, ...)
364 va_list arg;
365 int done;
367 va_start (arg, fmt);
368 done = __nldbl_vsscanf (s, fmt, arg);
369 va_end (arg);
371 return done;
373 strong_alias (__nldbl_sscanf, __nldbl__IO_sscanf)
376 attribute_compat_text_section
377 __nldbl___vsscanf (const char *string, const char *fmt, va_list ap)
379 int res;
380 __no_long_double = 1;
381 res = _IO_vsscanf (string, fmt, ap);
382 __no_long_double = 0;
383 return res;
385 weak_alias (__nldbl___vsscanf, __nldbl_vsscanf)
386 libc_hidden_def (__nldbl_vsscanf)
389 attribute_compat_text_section weak_function
390 __nldbl_vscanf (const char *fmt, va_list ap)
392 return __nldbl_vfscanf (stdin, fmt, ap);
396 attribute_compat_text_section
397 __nldbl_fscanf (FILE *stream, const char *fmt, ...)
399 va_list arg;
400 int done;
402 va_start (arg, fmt);
403 done = __nldbl_vfscanf (stream, fmt, arg);
404 va_end (arg);
406 return done;
410 attribute_compat_text_section
411 __nldbl_scanf (const char *fmt, ...)
413 va_list arg;
414 int done;
416 va_start (arg, fmt);
417 done = __nldbl_vfscanf (stdin, fmt, arg);
418 va_end (arg);
420 return done;
424 attribute_compat_text_section
425 __nldbl_vfwscanf (FILE *s, const wchar_t *fmt, va_list ap)
427 int res;
428 set_no_long_double ();
429 res = _IO_vfwscanf (s, fmt, ap, NULL);
430 clear_no_long_double ();
431 return res;
433 libc_hidden_def (__nldbl_vfwscanf)
436 attribute_compat_text_section
437 __nldbl_swscanf (const wchar_t *s, const wchar_t *fmt, ...)
439 va_list arg;
440 int done;
442 va_start (arg, fmt);
443 done = __nldbl_vswscanf (s, fmt, arg);
444 va_end (arg);
446 return done;
450 attribute_compat_text_section
451 __nldbl_vswscanf (const wchar_t *string, const wchar_t *fmt, va_list ap)
453 int res;
454 __no_long_double = 1;
455 res = vswscanf (string, fmt, ap);
456 __no_long_double = 0;
457 return res;
459 libc_hidden_def (__nldbl_vswscanf)
462 attribute_compat_text_section weak_function
463 __nldbl_vwscanf (const wchar_t *fmt, va_list ap)
465 return __nldbl_vfwscanf (stdin, fmt, ap);
469 attribute_compat_text_section
470 __nldbl_fwscanf (FILE *stream, const wchar_t *fmt, ...)
472 va_list arg;
473 int done;
475 va_start (arg, fmt);
476 done = __nldbl_vfwscanf (stream, fmt, arg);
477 va_end (arg);
479 return done;
483 attribute_compat_text_section
484 __nldbl_wscanf (const wchar_t *fmt, ...)
486 va_list arg;
487 int done;
489 va_start (arg, fmt);
490 done = __nldbl_vfwscanf (stdin, fmt, arg);
491 va_end (arg);
493 return done;
497 attribute_compat_text_section
498 __nldbl___fprintf_chk (FILE *stream, int flag, const char *fmt, ...)
500 va_list arg;
501 int done;
503 va_start (arg, fmt);
504 done = __nldbl___vfprintf_chk (stream, flag, fmt, arg);
505 va_end (arg);
507 return done;
511 attribute_compat_text_section
512 __nldbl___fwprintf_chk (FILE *stream, int flag, const wchar_t *fmt, ...)
514 va_list arg;
515 int done;
517 va_start (arg, fmt);
518 done = __nldbl___vfwprintf_chk (stream, flag, fmt, arg);
519 va_end (arg);
521 return done;
525 attribute_compat_text_section
526 __nldbl___printf_chk (int flag, const char *fmt, ...)
528 va_list arg;
529 int done;
531 va_start (arg, fmt);
532 done = __nldbl___vfprintf_chk (stdout, flag, fmt, arg);
533 va_end (arg);
535 return done;
539 attribute_compat_text_section
540 __nldbl___snprintf_chk (char *s, size_t maxlen, int flag, size_t slen,
541 const char *fmt, ...)
543 va_list arg;
544 int done;
546 va_start (arg, fmt);
547 done = __nldbl___vsnprintf_chk (s, maxlen, flag, slen, fmt, arg);
548 va_end (arg);
550 return done;
554 attribute_compat_text_section
555 __nldbl___sprintf_chk (char *s, int flag, size_t slen, const char *fmt, ...)
557 va_list arg;
558 int done;
560 va_start (arg, fmt);
561 done = __nldbl___vsprintf_chk (s, flag, slen, fmt, arg);
562 va_end (arg);
564 return done;
568 attribute_compat_text_section
569 __nldbl___swprintf_chk (wchar_t *s, size_t n, int flag, size_t slen,
570 const wchar_t *fmt, ...)
572 va_list arg;
573 int done;
575 va_start (arg, fmt);
576 done = __nldbl___vswprintf_chk (s, n, flag, slen, fmt, arg);
577 va_end (arg);
579 return done;
583 attribute_compat_text_section
584 __nldbl___vfprintf_chk (FILE *s, int flag, const char *fmt, va_list ap)
586 int res;
587 set_no_long_double ();
588 res = __vfprintf_chk (s, flag, fmt, ap);
589 clear_no_long_double ();
590 return res;
592 libc_hidden_def (__nldbl___vfprintf_chk)
595 attribute_compat_text_section
596 __nldbl___vfwprintf_chk (FILE *s, int flag, const wchar_t *fmt, va_list ap)
598 int res;
599 set_no_long_double ();
600 res = __vfwprintf_chk (s, flag, fmt, ap);
601 clear_no_long_double ();
602 return res;
604 libc_hidden_def (__nldbl___vfwprintf_chk)
607 attribute_compat_text_section
608 __nldbl___vprintf_chk (int flag, const char *fmt, va_list ap)
610 return __nldbl___vfprintf_chk (stdout, flag, fmt, ap);
614 attribute_compat_text_section
615 __nldbl___vsnprintf_chk (char *string, size_t maxlen, int flag, size_t slen,
616 const char *fmt, va_list ap)
618 int res;
619 __no_long_double = 1;
620 res = __vsnprintf_chk (string, maxlen, flag, slen, fmt, ap);
621 __no_long_double = 0;
622 return res;
624 libc_hidden_def (__nldbl___vsnprintf_chk)
627 attribute_compat_text_section
628 __nldbl___vsprintf_chk (char *string, int flag, size_t slen, const char *fmt,
629 va_list ap)
631 int res;
632 __no_long_double = 1;
633 res = __vsprintf_chk (string, flag, slen, fmt, ap);
634 __no_long_double = 0;
635 return res;
637 libc_hidden_def (__nldbl___vsprintf_chk)
640 attribute_compat_text_section
641 __nldbl___vswprintf_chk (wchar_t *string, size_t maxlen, int flag, size_t slen,
642 const wchar_t *fmt, va_list ap)
644 int res;
645 __no_long_double = 1;
646 res = __vswprintf_chk (string, maxlen, flag, slen, fmt, ap);
647 __no_long_double = 0;
648 return res;
650 libc_hidden_def (__nldbl___vswprintf_chk)
653 attribute_compat_text_section
654 __nldbl___vwprintf_chk (int flag, const wchar_t *fmt, va_list ap)
656 return __nldbl___vfwprintf_chk (stdout, flag, fmt, ap);
660 attribute_compat_text_section
661 __nldbl___wprintf_chk (int flag, const wchar_t *fmt, ...)
663 va_list arg;
664 int done;
666 va_start (arg, fmt);
667 done = __nldbl___vfwprintf_chk (stdout, flag, fmt, arg);
668 va_end (arg);
670 return done;
674 attribute_compat_text_section
675 __nldbl___vasprintf_chk (char **ptr, int flag, const char *fmt, va_list arg)
677 int res;
678 __no_long_double = 1;
679 res = __vasprintf_chk (ptr, flag, fmt, arg);
680 __no_long_double = 0;
681 return res;
683 libc_hidden_def (__nldbl___vasprintf_chk)
686 attribute_compat_text_section
687 __nldbl___asprintf_chk (char **ptr, int flag, const char *fmt, ...)
689 va_list arg;
690 int done;
692 va_start (arg, fmt);
693 done = __nldbl___vasprintf_chk (ptr, flag, fmt, arg);
694 va_end (arg);
696 return done;
700 attribute_compat_text_section
701 __nldbl___vdprintf_chk (int d, int flag, const char *fmt, va_list arg)
703 int res;
704 set_no_long_double ();
705 res = __vdprintf_chk (d, flag, fmt, arg);
706 clear_no_long_double ();
707 return res;
709 libc_hidden_def (__nldbl___vdprintf_chk)
712 attribute_compat_text_section
713 __nldbl___dprintf_chk (int d, int flag, const char *fmt, ...)
715 va_list arg;
716 int done;
718 va_start (arg, fmt);
719 done = __nldbl___vdprintf_chk (d, flag, fmt, arg);
720 va_end (arg);
722 return done;
726 attribute_compat_text_section
727 __nldbl___obstack_vprintf_chk (struct obstack *obstack, int flag,
728 const char *fmt, va_list arg)
730 int res;
731 __no_long_double = 1;
732 res = __obstack_vprintf_chk (obstack, flag, fmt, arg);
733 __no_long_double = 0;
734 return res;
736 libc_hidden_def (__nldbl___obstack_vprintf_chk)
739 attribute_compat_text_section
740 __nldbl___obstack_printf_chk (struct obstack *obstack, int flag,
741 const char *fmt, ...)
743 va_list arg;
744 int done;
746 va_start (arg, fmt);
747 done = __nldbl___obstack_vprintf_chk (obstack, flag, fmt, arg);
748 va_end (arg);
750 return done;
753 extern __typeof (printf_size) __printf_size;
756 attribute_compat_text_section
757 __nldbl_printf_size (FILE *fp, const struct printf_info *info,
758 const void *const *args)
760 struct printf_info info_no_ldbl = *info;
762 info_no_ldbl.is_long_double = 0;
763 return __printf_size (fp, &info_no_ldbl, args);
766 extern __typeof (__printf_fp) ___printf_fp;
769 attribute_compat_text_section
770 __nldbl___printf_fp (FILE *fp, const struct printf_info *info,
771 const void *const *args)
773 struct printf_info info_no_ldbl = *info;
775 info_no_ldbl.is_long_double = 0;
776 return ___printf_fp (fp, &info_no_ldbl, args);
779 ssize_t
780 attribute_compat_text_section
781 __nldbl_strfmon (char *s, size_t maxsize, const char *format, ...)
783 va_list ap;
784 ssize_t res;
786 va_start (ap, format);
787 res = __nldbl___vstrfmon (s, maxsize, format, ap);
788 va_end (ap);
789 return res;
792 ssize_t
793 attribute_compat_text_section
794 __nldbl___strfmon_l (char *s, size_t maxsize, __locale_t loc,
795 const char *format, ...)
797 va_list ap;
798 ssize_t res;
800 va_start (ap, format);
801 res = __nldbl___vstrfmon_l (s, maxsize, loc, format, ap);
802 va_end (ap);
803 return res;
805 weak_alias (__nldbl___strfmon_l, __nldbl_strfmon_l)
807 ssize_t
808 attribute_compat_text_section
809 __nldbl___vstrfmon (char *s, size_t maxsize, const char *format, va_list ap)
811 ssize_t res;
812 __no_long_double = 1;
813 res = __vstrfmon_l (s, maxsize, _NL_CURRENT_LOCALE, format, ap);
814 __no_long_double = 0;
815 va_end (ap);
816 return res;
818 libc_hidden_def (__nldbl___vstrfmon)
820 ssize_t
821 attribute_compat_text_section
822 __nldbl___vstrfmon_l (char *s, size_t maxsize, __locale_t loc,
823 const char *format, va_list ap)
825 ssize_t res;
826 __no_long_double = 1;
827 res = __vstrfmon_l (s, maxsize, loc, format, ap);
828 __no_long_double = 0;
829 va_end (ap);
830 return res;
832 libc_hidden_def (__nldbl___vstrfmon_l)
834 void
835 attribute_compat_text_section
836 __nldbl_syslog (int pri, const char *fmt, ...)
838 va_list ap;
839 va_start (ap, fmt);
840 __nldbl___vsyslog_chk (pri, -1, fmt, ap);
841 va_end (ap);
844 void
845 attribute_compat_text_section
846 __nldbl___syslog_chk (int pri, int flag, const char *fmt, ...)
848 va_list ap;
850 va_start (ap, fmt);
851 __nldbl___vsyslog_chk (pri, flag, fmt, ap);
852 va_end(ap);
855 void
856 attribute_compat_text_section
857 __nldbl___vsyslog_chk (int pri, int flag, const char *fmt, va_list ap)
859 set_no_long_double ();
860 __vsyslog_chk (pri, flag, fmt, ap);
861 clear_no_long_double ();
863 libc_hidden_def (__nldbl___vsyslog_chk)
865 void
866 attribute_compat_text_section
867 __nldbl_vsyslog (int pri, const char *fmt, va_list ap)
869 __nldbl___vsyslog_chk (pri, -1, fmt, ap);
873 attribute_compat_text_section
874 __nldbl___isoc99_vfscanf (FILE *s, const char *fmt, va_list ap)
876 int res;
877 set_no_long_double ();
878 res = __isoc99_vfscanf (s, fmt, ap);
879 clear_no_long_double ();
880 return res;
882 libc_hidden_def (__nldbl___isoc99_vfscanf)
885 attribute_compat_text_section
886 __nldbl___isoc99_sscanf (const char *s, const char *fmt, ...)
888 va_list arg;
889 int done;
891 va_start (arg, fmt);
892 done = __nldbl___isoc99_vsscanf (s, fmt, arg);
893 va_end (arg);
895 return done;
899 attribute_compat_text_section
900 __nldbl___isoc99_vsscanf (const char *string, const char *fmt, va_list ap)
902 int res;
903 __no_long_double = 1;
904 res = __isoc99_vsscanf (string, fmt, ap);
905 __no_long_double = 0;
906 return res;
908 libc_hidden_def (__nldbl___isoc99_vsscanf)
911 attribute_compat_text_section
912 __nldbl___isoc99_vscanf (const char *fmt, va_list ap)
914 return __nldbl___isoc99_vfscanf (stdin, fmt, ap);
918 attribute_compat_text_section
919 __nldbl___isoc99_fscanf (FILE *stream, const char *fmt, ...)
921 va_list arg;
922 int done;
924 va_start (arg, fmt);
925 done = __nldbl___isoc99_vfscanf (stream, fmt, arg);
926 va_end (arg);
928 return done;
932 attribute_compat_text_section
933 __nldbl___isoc99_scanf (const char *fmt, ...)
935 va_list arg;
936 int done;
938 va_start (arg, fmt);
939 done = __nldbl___isoc99_vfscanf (stdin, fmt, arg);
940 va_end (arg);
942 return done;
946 attribute_compat_text_section
947 __nldbl___isoc99_vfwscanf (FILE *s, const wchar_t *fmt, va_list ap)
949 int res;
950 set_no_long_double ();
951 res = __isoc99_vfwscanf (s, fmt, ap);
952 clear_no_long_double ();
953 return res;
955 libc_hidden_def (__nldbl___isoc99_vfwscanf)
958 attribute_compat_text_section
959 __nldbl___isoc99_swscanf (const wchar_t *s, const wchar_t *fmt, ...)
961 va_list arg;
962 int done;
964 va_start (arg, fmt);
965 done = __nldbl___isoc99_vswscanf (s, fmt, arg);
966 va_end (arg);
968 return done;
972 attribute_compat_text_section
973 __nldbl___isoc99_vswscanf (const wchar_t *string, const wchar_t *fmt,
974 va_list ap)
976 int res;
977 __no_long_double = 1;
978 res = __isoc99_vswscanf (string, fmt, ap);
979 __no_long_double = 0;
980 return res;
982 libc_hidden_def (__nldbl___isoc99_vswscanf)
985 attribute_compat_text_section
986 __nldbl___isoc99_vwscanf (const wchar_t *fmt, va_list ap)
988 return __nldbl___isoc99_vfwscanf (stdin, fmt, ap);
992 attribute_compat_text_section
993 __nldbl___isoc99_fwscanf (FILE *stream, const wchar_t *fmt, ...)
995 va_list arg;
996 int done;
998 va_start (arg, fmt);
999 done = __nldbl___isoc99_vfwscanf (stream, fmt, arg);
1000 va_end (arg);
1002 return done;
1006 attribute_compat_text_section
1007 __nldbl___isoc99_wscanf (const wchar_t *fmt, ...)
1009 va_list arg;
1010 int done;
1012 va_start (arg, fmt);
1013 done = __nldbl___isoc99_vfwscanf (stdin, fmt, arg);
1014 va_end (arg);
1016 return done;
1019 #if LONG_DOUBLE_COMPAT(libc, GLIBC_2_0)
1020 compat_symbol (libc, __nldbl__IO_printf, _IO_printf, GLIBC_2_0);
1021 compat_symbol (libc, __nldbl__IO_sprintf, _IO_sprintf, GLIBC_2_0);
1022 compat_symbol (libc, __nldbl__IO_vfprintf, _IO_vfprintf, GLIBC_2_0);
1023 compat_symbol (libc, __nldbl__IO_vsprintf, _IO_vsprintf, GLIBC_2_0);
1024 compat_symbol (libc, __nldbl_dprintf, dprintf, GLIBC_2_0);
1025 compat_symbol (libc, __nldbl_fprintf, fprintf, GLIBC_2_0);
1026 compat_symbol (libc, __nldbl_printf, printf, GLIBC_2_0);
1027 compat_symbol (libc, __nldbl_sprintf, sprintf, GLIBC_2_0);
1028 compat_symbol (libc, __nldbl_vfprintf, vfprintf, GLIBC_2_0);
1029 compat_symbol (libc, __nldbl_vprintf, vprintf, GLIBC_2_0);
1030 compat_symbol (libc, __nldbl__IO_fprintf, _IO_fprintf, GLIBC_2_0);
1031 compat_symbol (libc, __nldbl___vsnprintf, __vsnprintf, GLIBC_2_0);
1032 compat_symbol (libc, __nldbl_asprintf, asprintf, GLIBC_2_0);
1033 compat_symbol (libc, __nldbl_obstack_printf, obstack_printf, GLIBC_2_0);
1034 compat_symbol (libc, __nldbl_obstack_vprintf, obstack_vprintf, GLIBC_2_0);
1035 compat_symbol (libc, __nldbl_snprintf, snprintf, GLIBC_2_0);
1036 compat_symbol (libc, __nldbl_vasprintf, vasprintf, GLIBC_2_0);
1037 compat_symbol (libc, __nldbl_vdprintf, vdprintf, GLIBC_2_0);
1038 compat_symbol (libc, __nldbl_vsnprintf, vsnprintf, GLIBC_2_0);
1039 compat_symbol (libc, __nldbl_vsprintf, vsprintf, GLIBC_2_0);
1040 compat_symbol (libc, __nldbl__IO_sscanf, _IO_sscanf, GLIBC_2_0);
1041 compat_symbol (libc, __nldbl__IO_vfscanf, _IO_vfscanf, GLIBC_2_0);
1042 compat_symbol (libc, __nldbl___vfscanf, __vfscanf, GLIBC_2_0);
1043 compat_symbol (libc, __nldbl___vsscanf, __vsscanf, GLIBC_2_0);
1044 compat_symbol (libc, __nldbl_fscanf, fscanf, GLIBC_2_0);
1045 compat_symbol (libc, __nldbl_scanf, scanf, GLIBC_2_0);
1046 compat_symbol (libc, __nldbl_sscanf, sscanf, GLIBC_2_0);
1047 compat_symbol (libc, __nldbl_vfscanf, vfscanf, GLIBC_2_0);
1048 compat_symbol (libc, __nldbl_vscanf, vscanf, GLIBC_2_0);
1049 compat_symbol (libc, __nldbl_vsscanf, vsscanf, GLIBC_2_0);
1050 compat_symbol (libc, __nldbl___printf_fp, __printf_fp, GLIBC_2_0);
1051 compat_symbol (libc, __nldbl_strfmon, strfmon, GLIBC_2_0);
1052 compat_symbol (libc, __nldbl_syslog, syslog, GLIBC_2_0);
1053 compat_symbol (libc, __nldbl_vsyslog, vsyslog, GLIBC_2_0);
1054 #endif
1055 #if LONG_DOUBLE_COMPAT(libc, GLIBC_2_1)
1056 compat_symbol (libc, __nldbl___asprintf, __asprintf, GLIBC_2_1);
1057 compat_symbol (libc, __nldbl_printf_size, printf_size, GLIBC_2_1);
1058 compat_symbol (libc, __nldbl___strfmon_l, __strfmon_l, GLIBC_2_1);
1059 #endif
1060 #if LONG_DOUBLE_COMPAT(libc, GLIBC_2_2)
1061 compat_symbol (libc, __nldbl_swprintf, swprintf, GLIBC_2_2);
1062 compat_symbol (libc, __nldbl_vwprintf, vwprintf, GLIBC_2_2);
1063 compat_symbol (libc, __nldbl_wprintf, wprintf, GLIBC_2_2);
1064 compat_symbol (libc, __nldbl_fwprintf, fwprintf, GLIBC_2_2);
1065 compat_symbol (libc, __nldbl_vfwprintf, vfwprintf, GLIBC_2_2);
1066 compat_symbol (libc, __nldbl_vswprintf, vswprintf, GLIBC_2_2);
1067 compat_symbol (libc, __nldbl_fwscanf, fwscanf, GLIBC_2_2);
1068 compat_symbol (libc, __nldbl_swscanf, swscanf, GLIBC_2_2);
1069 compat_symbol (libc, __nldbl_vfwscanf, vfwscanf, GLIBC_2_2);
1070 compat_symbol (libc, __nldbl_vswscanf, vswscanf, GLIBC_2_2);
1071 compat_symbol (libc, __nldbl_vwscanf, vwscanf, GLIBC_2_2);
1072 compat_symbol (libc, __nldbl_wscanf, wscanf, GLIBC_2_2);
1073 #endif
1074 #if LONG_DOUBLE_COMPAT(libc, GLIBC_2_3)
1075 compat_symbol (libc, __nldbl_strfmon_l, strfmon_l, GLIBC_2_3);
1076 #endif
1077 #if LONG_DOUBLE_COMPAT(libc, GLIBC_2_3_4)
1078 compat_symbol (libc, __nldbl___sprintf_chk, __sprintf_chk, GLIBC_2_3_4);
1079 compat_symbol (libc, __nldbl___vsprintf_chk, __vsprintf_chk, GLIBC_2_3_4);
1080 compat_symbol (libc, __nldbl___snprintf_chk, __snprintf_chk, GLIBC_2_3_4);
1081 compat_symbol (libc, __nldbl___vsnprintf_chk, __vsnprintf_chk, GLIBC_2_3_4);
1082 compat_symbol (libc, __nldbl___printf_chk, __printf_chk, GLIBC_2_3_4);
1083 compat_symbol (libc, __nldbl___fprintf_chk, __fprintf_chk, GLIBC_2_3_4);
1084 compat_symbol (libc, __nldbl___vprintf_chk, __vprintf_chk, GLIBC_2_3_4);
1085 compat_symbol (libc, __nldbl___vfprintf_chk, __vfprintf_chk, GLIBC_2_3_4);
1086 #endif