stdio-ldbl.h 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  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 stdio 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 _STDIO_H
  31. # error "Never include <bits/stdio-ldbl.h> directly; use <stdio.h> instead."
  32. #endif
  33. __LDBL_REDIR_DECL (fprintf)
  34. __LDBL_REDIR_DECL (printf)
  35. __LDBL_REDIR_DECL (sprintf)
  36. __LDBL_REDIR_DECL (vfprintf)
  37. __LDBL_REDIR_DECL (vprintf)
  38. __LDBL_REDIR_DECL (vsprintf)
  39. #if !__GLIBC_USE (DEPRECATED_SCANF)
  40. # if defined __LDBL_COMPAT
  41. # if __GLIBC_USE (C23_STRTOL)
  42. __LDBL_REDIR1_DECL (fscanf, __nldbl___isoc23_fscanf)
  43. __LDBL_REDIR1_DECL (scanf, __nldbl___isoc23_scanf)
  44. __LDBL_REDIR1_DECL (sscanf, __nldbl___isoc23_sscanf)
  45. # else
  46. __LDBL_REDIR1_DECL (fscanf, __nldbl___isoc99_fscanf)
  47. __LDBL_REDIR1_DECL (scanf, __nldbl___isoc99_scanf)
  48. __LDBL_REDIR1_DECL (sscanf, __nldbl___isoc99_sscanf)
  49. # endif
  50. # elif __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1
  51. # if __GLIBC_USE (C23_STRTOL)
  52. __LDBL_REDIR1_DECL (fscanf, __isoc23_fscanfieee128)
  53. __LDBL_REDIR1_DECL (scanf, __isoc23_scanfieee128)
  54. __LDBL_REDIR1_DECL (sscanf, __isoc23_sscanfieee128)
  55. # else
  56. __LDBL_REDIR1_DECL (fscanf, __isoc99_fscanfieee128)
  57. __LDBL_REDIR1_DECL (scanf, __isoc99_scanfieee128)
  58. __LDBL_REDIR1_DECL (sscanf, __isoc99_sscanfieee128)
  59. # endif
  60. # else
  61. # error bits/stdlib-ldbl.h included when no ldbl redirections are required.
  62. # endif
  63. #else
  64. __LDBL_REDIR_DECL (fscanf)
  65. __LDBL_REDIR_DECL (scanf)
  66. __LDBL_REDIR_DECL (sscanf)
  67. #endif
  68. #if defined __USE_ISOC99 || defined __USE_UNIX98
  69. __LDBL_REDIR_DECL (snprintf)
  70. __LDBL_REDIR_DECL (vsnprintf)
  71. #endif
  72. #ifdef __USE_ISOC99
  73. # if !__GLIBC_USE (DEPRECATED_SCANF)
  74. # if defined __LDBL_COMPAT
  75. # if __GLIBC_USE (C23_STRTOL)
  76. __LDBL_REDIR1_DECL (vfscanf, __nldbl___isoc23_vfscanf)
  77. __LDBL_REDIR1_DECL (vscanf, __nldbl___isoc23_vscanf)
  78. __LDBL_REDIR1_DECL (vsscanf, __nldbl___isoc23_vsscanf)
  79. # else
  80. __LDBL_REDIR1_DECL (vfscanf, __nldbl___isoc99_vfscanf)
  81. __LDBL_REDIR1_DECL (vscanf, __nldbl___isoc99_vscanf)
  82. __LDBL_REDIR1_DECL (vsscanf, __nldbl___isoc99_vsscanf)
  83. # endif
  84. # elif __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1
  85. # if __GLIBC_USE (C23_STRTOL)
  86. __LDBL_REDIR1_DECL (vfscanf, __isoc23_vfscanfieee128)
  87. __LDBL_REDIR1_DECL (vscanf, __isoc23_vscanfieee128)
  88. __LDBL_REDIR1_DECL (vsscanf, __isoc23_vsscanfieee128)
  89. # else
  90. __LDBL_REDIR1_DECL (vfscanf, __isoc99_vfscanfieee128)
  91. __LDBL_REDIR1_DECL (vscanf, __isoc99_vscanfieee128)
  92. __LDBL_REDIR1_DECL (vsscanf, __isoc99_vsscanfieee128)
  93. # endif
  94. # else
  95. # error bits/stdlib-ldbl.h included when no ldbl redirections are required.
  96. # endif
  97. # else
  98. __LDBL_REDIR_DECL (vfscanf)
  99. __LDBL_REDIR_DECL (vsscanf)
  100. __LDBL_REDIR_DECL (vscanf)
  101. # endif
  102. #endif
  103. #ifdef __USE_XOPEN2K8
  104. __LDBL_REDIR_DECL (vdprintf)
  105. __LDBL_REDIR_DECL (dprintf)
  106. #endif
  107. #ifdef __USE_GNU
  108. __LDBL_REDIR_DECL (vasprintf)
  109. __LDBL_REDIR2_DECL (asprintf)
  110. __LDBL_REDIR_DECL (asprintf)
  111. __LDBL_REDIR_DECL (obstack_printf)
  112. __LDBL_REDIR_DECL (obstack_vprintf)
  113. #endif
  114. #if __USE_FORTIFY_LEVEL > 0 && defined __fortify_function
  115. __LDBL_REDIR2_DECL (sprintf_chk)
  116. __LDBL_REDIR2_DECL (vsprintf_chk)
  117. # if defined __USE_ISOC99 || defined __USE_UNIX98
  118. __LDBL_REDIR2_DECL (snprintf_chk)
  119. __LDBL_REDIR2_DECL (vsnprintf_chk)
  120. # endif
  121. # if __USE_FORTIFY_LEVEL > 1
  122. __LDBL_REDIR2_DECL (fprintf_chk)
  123. __LDBL_REDIR2_DECL (printf_chk)
  124. __LDBL_REDIR2_DECL (vfprintf_chk)
  125. __LDBL_REDIR2_DECL (vprintf_chk)
  126. # ifdef __USE_XOPEN2K8
  127. __LDBL_REDIR2_DECL (dprintf_chk)
  128. __LDBL_REDIR2_DECL (vdprintf_chk)
  129. # endif
  130. # ifdef __USE_GNU
  131. __LDBL_REDIR2_DECL (asprintf_chk)
  132. __LDBL_REDIR2_DECL (vasprintf_chk)
  133. __LDBL_REDIR2_DECL (obstack_printf_chk)
  134. __LDBL_REDIR2_DECL (obstack_vprintf_chk)
  135. # endif
  136. # endif
  137. #endif