master
  1/* -mlong-double-64 compatibility mode for <wchar.h> functions.
  2   Copyright (C) 2006-2025 Free Software Foundation, Inc.
  3   This file is part of the GNU C Library.
  4
  5   The GNU C Library is free software; you can redistribute it and/or
  6   modify it under the terms of the GNU Lesser General Public
  7   License as published by the Free Software Foundation; either
  8   version 2.1 of the License, or (at your option) any later version.
  9
 10   The GNU C Library is distributed in the hope that it will be useful,
 11   but WITHOUT ANY WARRANTY; without even the implied warranty of
 12   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 13   Lesser General Public License for more details.
 14
 15   You should have received a copy of the GNU Lesser General Public
 16   License along with the GNU C Library; if not, see
 17   <https://www.gnu.org/licenses/>.  */
 18
 19#ifndef _WCHAR_H
 20# error "Never include <bits/wchar-ldbl.h> directly; use <wchar.h> instead."
 21#endif
 22
 23#if defined __USE_ISOC95 || defined __USE_UNIX98
 24__LDBL_REDIR_DECL (fwprintf);
 25__LDBL_REDIR_DECL (wprintf);
 26__LDBL_REDIR_DECL (swprintf);
 27__LDBL_REDIR_DECL (vfwprintf);
 28__LDBL_REDIR_DECL (vwprintf);
 29__LDBL_REDIR_DECL (vswprintf);
 30# if !__GLIBC_USE (DEPRECATED_SCANF)
 31#  if defined __LDBL_COMPAT
 32#   if __GLIBC_USE (C23_STRTOL)
 33__LDBL_REDIR1_DECL (fwscanf, __nldbl___isoc23_fwscanf)
 34__LDBL_REDIR1_DECL (wscanf, __nldbl___isoc23_wscanf)
 35__LDBL_REDIR1_DECL (swscanf, __nldbl___isoc23_swscanf)
 36#   else
 37__LDBL_REDIR1_DECL (fwscanf, __nldbl___isoc99_fwscanf)
 38__LDBL_REDIR1_DECL (wscanf, __nldbl___isoc99_wscanf)
 39__LDBL_REDIR1_DECL (swscanf, __nldbl___isoc99_swscanf)
 40#   endif
 41#  elif __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1
 42#   if __GLIBC_USE (C23_STRTOL)
 43__LDBL_REDIR1_DECL (fwscanf, __isoc23_fwscanfieee128)
 44__LDBL_REDIR1_DECL (wscanf, __isoc23_wscanfieee128)
 45__LDBL_REDIR1_DECL (swscanf, __isoc23_swscanfieee128)
 46#   else
 47__LDBL_REDIR1_DECL (fwscanf, __isoc99_fwscanfieee128)
 48__LDBL_REDIR1_DECL (wscanf, __isoc99_wscanfieee128)
 49__LDBL_REDIR1_DECL (swscanf, __isoc99_swscanfieee128)
 50#   endif
 51#  else
 52#   error bits/stdlib-ldbl.h included when no ldbl redirections are required.
 53#  endif
 54# else
 55__LDBL_REDIR_DECL (fwscanf);
 56__LDBL_REDIR_DECL (wscanf);
 57__LDBL_REDIR_DECL (swscanf);
 58# endif
 59#endif
 60
 61#ifdef __USE_ISOC99
 62# ifdef __LDBL_COMPAT
 63__LDBL_REDIR1_DECL (wcstold, wcstod);
 64# else
 65__LDBL_REDIR1_DECL (wcstold, __wcstoieee128)
 66# endif
 67# if !__GLIBC_USE (DEPRECATED_SCANF)
 68#  if defined __LDBL_COMPAT
 69#   if __GLIBC_USE (C23_STRTOL)
 70__LDBL_REDIR1_DECL (vfwscanf, __nldbl___isoc23_vfwscanf)
 71__LDBL_REDIR1_DECL (vwscanf, __nldbl___isoc23_vwscanf)
 72__LDBL_REDIR1_DECL (vswscanf, __nldbl___isoc23_vswscanf)
 73#   else
 74__LDBL_REDIR1_DECL (vfwscanf, __nldbl___isoc99_vfwscanf)
 75__LDBL_REDIR1_DECL (vwscanf, __nldbl___isoc99_vwscanf)
 76__LDBL_REDIR1_DECL (vswscanf, __nldbl___isoc99_vswscanf)
 77#   endif
 78#  elif __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1
 79#   if __GLIBC_USE (C23_STRTOL)
 80__LDBL_REDIR1_DECL (vfwscanf, __isoc23_vfwscanfieee128)
 81__LDBL_REDIR1_DECL (vwscanf, __isoc23_vwscanfieee128)
 82__LDBL_REDIR1_DECL (vswscanf, __isoc23_vswscanfieee128)
 83#   else
 84__LDBL_REDIR1_DECL (vfwscanf, __isoc99_vfwscanfieee128)
 85__LDBL_REDIR1_DECL (vwscanf, __isoc99_vwscanfieee128)
 86__LDBL_REDIR1_DECL (vswscanf, __isoc99_vswscanfieee128)
 87#   endif
 88#  else
 89#   error bits/stdlib-ldbl.h included when no ldbl redirections are required.
 90#  endif
 91# else
 92__LDBL_REDIR_DECL (vfwscanf);
 93__LDBL_REDIR_DECL (vwscanf);
 94__LDBL_REDIR_DECL (vswscanf);
 95# endif
 96#endif
 97
 98#ifdef __USE_GNU
 99# ifdef __LDBL_COMPAT
100__LDBL_REDIR1_DECL (wcstold_l, wcstod_l);
101# else
102__LDBL_REDIR1_DECL (wcstold_l, __wcstoieee128_l)
103# endif
104#endif
105
106#if __USE_FORTIFY_LEVEL > 0 && defined __fortify_function
107__LDBL_REDIR2_DECL (swprintf_chk)
108__LDBL_REDIR2_DECL (vswprintf_chk)
109# if __USE_FORTIFY_LEVEL > 1
110__LDBL_REDIR2_DECL (fwprintf_chk)
111__LDBL_REDIR2_DECL (wprintf_chk)
112__LDBL_REDIR2_DECL (vfwprintf_chk)
113__LDBL_REDIR2_DECL (vwprintf_chk)
114# endif
115#endif