wchar-ldbl.h 4.4 KB

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